1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-21 20:38:57 +00:00

run command: more usefull error message when specifying non-existing agenda path

If the specified agenda argument is not found in the file system, WA
assumes it is the name of a workload and would then raise an "extension
not found error", which may be confusing if the user's intension was to
specify a path.

Now, WA will first check that neither path separator, nor a '.' are
present in the agenda argument before assuming it is a workload name, and
will provide a less confusing error in that case.
This commit is contained in:
Sergei Trofimov 2016-02-29 17:21:53 +00:00
parent a68e46eb0a
commit 0c1e01cad4

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()