From 5c1440dc02e4cb2677ad404b77a8901dd60a696f Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Wed, 16 Mar 2016 15:50:42 +0000 Subject: Reduce nesting a little Should have done it this way in 2e3195f. Change-Id: I015a3c1241a59277801cf39865f87e8c3ac96747 --- lorrycontroller/lstroves.py | 5 ++--- lorrycontroller/readconf.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'lorrycontroller') 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): -- cgit v1.2.1