simplify resolver constructor

This commit is contained in:
gcarq 2018-03-24 23:22:31 +01:00
parent 280886104c
commit 99e890bc99

View File

@ -30,13 +30,7 @@ class StrategyResolver(object):
config = config or {}
# Verify the strategy is in the configuration, otherwise fallback to the default strategy
if 'strategy' in config:
strategy = config['strategy']
else:
strategy = Constants.DEFAULT_STRATEGY
# Try to load the strategy
self.strategy = self._load_strategy(strategy)
self.strategy = self._load_strategy(config.get('strategy') or Constants.DEFAULT_STRATEGY)
# Set attributes
# Check if we need to override configuration