From d3f6c62ea01fca8fd46cfa51506b46153511440f Mon Sep 17 00:00:00 2001 From: Jimmy Berry Date: Tue, 3 Sep 2019 15:17:32 -0500 Subject: [PATCH] osclib/request_splitter: replace map() calls with loop and call. Python 3 makes map() a lazy call and since the result is not needed it makes sense to just switch to explicit loop. Without this the "loop" (via map) is never executed. As such, --try-strategies effective does nothing and instead the staging-bot always falls back to none strategy. --- osclib/request_splitter.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osclib/request_splitter.py b/osclib/request_splitter.py index e79c1a61..670fcf12 100644 --- a/osclib/request_splitter.py +++ b/osclib/request_splitter.py @@ -329,7 +329,8 @@ class RequestSplitter(object): 'devel', ) - map(self.strategy_try, strategies) + for strategy in strategies: + self.strategy_try(strategy) def strategy_try(self, name): self.strategy_set(name) @@ -414,10 +415,12 @@ class StrategyCustom(StrategyNone): if 'filters' not in self.kwargs: super(StrategyCustom, self).apply(splitter) else: - map(splitter.filter_add, self.kwargs['filters']) + for xpath in self.kwargs['filters']: + splitter.filter_add(xpath) if 'groups' in self.kwargs: - map(splitter.group_by, self.kwargs['groups']) + for group in self.kwargs['groups']: + splitter.group_by(group) class StrategyDevel(StrategyNone): GROUP_MIN = 7