summaryrefslogtreecommitdiff
path: root/lorrycontroller/lstroves.py
diff options
context:
space:
mode:
Diffstat (limited to 'lorrycontroller/lstroves.py')
-rw-r--r--lorrycontroller/lstroves.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/lorrycontroller/lstroves.py b/lorrycontroller/lstroves.py
index e69dce2..72515f5 100644
--- a/lorrycontroller/lstroves.py
+++ b/lorrycontroller/lstroves.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2014 Codethink Limited
+# Copyright (C) 2014-2015 Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -14,12 +14,11 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+import fnmatch
import json
import logging
-import time
import bottle
-import cliapp
import lorrycontroller
@@ -83,8 +82,13 @@ class TroveRepositoryLister(object):
return repo_paths
def skip_ignored_repos(self, trovehost, repo_paths):
- ignored_paths = json.loads(trovehost['ignore'])
- return [x for x in repo_paths if x not in ignored_paths]
+ ignored_patterns = json.loads(trovehost['ignore'])
+
+ ignored_paths = set()
+ for pattern in ignored_patterns:
+ ignored_paths.update(fnmatch.filter(repo_paths, pattern))
+
+ return set(repo_paths).difference(ignored_paths)
def map_remote_repos_to_local_ones(self, trove_info, remote_paths):
'''Return a dict that maps each remote repo path to a local one.'''