1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-22 12:58:36 +00:00

Merge pull request #110 from setrofim/master

run command: more usefull error message when specifying non-existing agenda path
This commit is contained in:
Sebastian Goscik 2016-02-29 17:28:29 +00:00
commit 34d7e7055a

View File

@ -20,6 +20,7 @@ import shutil
import wlauto import wlauto
from wlauto import Command, settings from wlauto import Command, settings
from wlauto.exceptions import ConfigError
from wlauto.core.agenda import Agenda from wlauto.core.agenda import Agenda
from wlauto.core.execution import Executor from wlauto.core.execution import Executor
from wlauto.utils.log import add_log_file from wlauto.utils.log import add_log_file
@ -76,6 +77,8 @@ class RunCommand(Command):
agenda = Agenda(args.agenda) agenda = Agenda(args.agenda)
settings.agenda = args.agenda settings.agenda = args.agenda
shutil.copy(args.agenda, settings.meta_directory) shutil.copy(args.agenda, settings.meta_directory)
elif '.' in args.agenda or os.sep in args.agenda:
raise ConfigError('Agenda "{}" does not exist.'.format(args.agenda))
else: else:
self.logger.debug('{} is not a file; assuming workload name.'.format(args.agenda)) self.logger.debug('{} is not a file; assuming workload name.'.format(args.agenda))
agenda = Agenda() agenda = Agenda()