Disable Defaulting to DefaultStrategy

This commit is contained in:
Matthias
2019-09-21 19:54:44 +02:00
parent 52ff391c8a
commit b73426b91f
11 changed files with 25 additions and 14 deletions

View File

@@ -32,8 +32,11 @@ class StrategyResolver(IResolver):
"""
config = config or {}
# Verify the strategy is in the configuration, otherwise fallback to the default strategy
strategy_name = config.get('strategy') or constants.DEFAULT_STRATEGY
if not config.get('strategy'):
raise OperationalException("No strategy set. Please use `--strategy` to specify "
"the strategy class to use.")
strategy_name = config['strategy']
self.strategy: IStrategy = self._load_strategy(strategy_name,
config=config,
extra_dir=config.get('strategy_path'))