[fix] do not allow underscore in engine names - closes #708

This commit is contained in:
Adam Tauber 2016-09-28 22:30:05 +02:00
parent bee7b497a3
commit 86daef2063
2 changed files with 10 additions and 4 deletions

View File

@ -57,11 +57,17 @@ def load_module(filename):
def load_engine(engine_data):
engine_name = engine_data['engine']
if '_' in engine_data['name']:
logger.error('Engine name conains underscore: "{}"'.format(engine_data['name']))
sys.exit(1)
engine_module = engine_data['engine']
try:
engine = load_module(engine_name + '.py')
engine = load_module(engine_module + '.py')
except:
logger.exception('Cannot load engine "{}"'.format(engine_name))
logger.exception('Cannot load engine "{}"'.format(engine_module))
return None
for param_name in engine_data:

View File

@ -377,7 +377,7 @@ engines:
timeout : 10.0
disabled : True
- name : scanr_structures
- name : scanr structures
shortcut: scs
engine : scanr_structures
disabled : True