summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2016-03-16 15:50:42 +0000
committerBen Brown <ben.brown@codethink.co.uk>2016-04-18 16:17:51 +0100
commit5c1440dc02e4cb2677ad404b77a8901dd60a696f (patch)
treee39bde628e6dcbd527bb915b418e07737719aa7a
parentce7951ae8f2725c427388eece9c1ad1ef28ba810 (diff)
downloadlorry-controller-5c1440dc02e4cb2677ad404b77a8901dd60a696f.tar.gz
Reduce nesting a little
Should have done it this way in 2e3195f. Change-Id: I015a3c1241a59277801cf39865f87e8c3ac96747
-rw-r--r--lorrycontroller/lstroves.py5
-rw-r--r--lorrycontroller/readconf.py2
2 files changed, 3 insertions, 4 deletions
diff --git a/lorrycontroller/lstroves.py b/lorrycontroller/lstroves.py
index e4fbbd4..72515f5 100644
--- a/lorrycontroller/lstroves.py
+++ b/lorrycontroller/lstroves.py
@@ -85,9 +85,8 @@ class TroveRepositoryLister(object):
ignored_patterns = json.loads(trovehost['ignore'])
ignored_paths = set()
- if ignored_patterns:
- for pattern in ignored_patterns:
- ignored_paths.update(fnmatch.filter(repo_paths, pattern))
+ for pattern in ignored_patterns:
+ ignored_paths.update(fnmatch.filter(repo_paths, pattern))
return set(repo_paths).difference(ignored_paths)
diff --git a/lorrycontroller/readconf.py b/lorrycontroller/readconf.py
index 4bcbce4..a108c41 100644
--- a/lorrycontroller/readconf.py
+++ b/lorrycontroller/readconf.py
@@ -296,7 +296,7 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute):
'lorry-timeout', self.DEFAULT_LORRY_TIMEOUT),
ls_interval=section['ls-interval'],
prefixmap=json.dumps(section['prefixmap']),
- ignore=json.dumps(section.get('ignore')))
+ ignore=json.dumps(section.get('ignore', [])))
class ValidationError(Exception):