If the check yaml file requires some input arguments and those arguments are not provided by the user when running the runtask command, the runner should complain and fail. For example see task-examplebodhi. Its yaml file says:
input: args: envr,arch
but if you run it without any args, it continues and fails in the middle of the check:
$ runtask examplebodhi.yml [libtaskotron:logger.py:61] 2014-03-20 15:05:54 DEBUG doing stream logging [libtaskotron:logger.py:34] 2014-03-20 15:05:57 CRITICAL Traceback (most recent call last): File "/home/kparal/devel/taskotron/env_taskotron/bin/runtask", line 9, in <module> load_entry_point('libtaskotron==0.0.3', 'console_scripts', 'runtask')() File "/home/kparal/devel/taskotron/libtaskotron/libtaskotron/runner.py", line 153, in main task_runner.run() File "/home/kparal/devel/taskotron/libtaskotron/libtaskotron/runner.py", line 32, in run self.do_actions() File "/home/kparal/devel/taskotron/libtaskotron/libtaskotron/runner.py", line 104, in do_actions self.do_single_action(action) File "/home/kparal/devel/taskotron/libtaskotron/libtaskotron/runner.py", line 94, in do_single_action self.envdata) File "/home/kparal/devel/taskotron/libtaskotron/libtaskotron/directives/python_directive.py", line 113, in process output = self.execute(task, method_name, input_data) File "/home/kparal/devel/taskotron/libtaskotron/libtaskotron/directives/python_directive.py", line 65, in execute output = task_method(**kwargs) File "run_examplebodhi.py", line 25, in run builds = [build['nvr'] for build in update['updates'][0]['builds']] IndexError: list index out of range
(The correct way to run this is e.g. runtask -e tigervnc-1.3.0-14.fc20 -a x86_64 examplebodhi.yml)
runtask -e tigervnc-1.3.0-14.fc20 -a x86_64 examplebodhi.yml
So, we must check if both envr and arch parameters were provided, and if not, we must complain and exit the runner.
envr
arch
Please don't forget to also add unit tests for this change.
Hasn't this been fixed? If I run task-rpmlint with no extra data using current libtaskotron (develop branch), I get:
$ python runtask.py ../task-rpmlint/rpmlint.yml [libtaskotron:logger.py:63] 2014-04-17 09:31:50 DEBUG doing stream logging [libtaskotron:logger.py:34] 2014-04-17 09:31:50 CRITICAL Traceback (most recent call last): File "runtask.py", line 4, in <module> runner.main() File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/runner.py", line 183, in main task_runner.run() File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/runner.py", line 28, in run self._validate_input() File "/home/tflink/code/taskotron/libtaskotron/libtaskotron/runner.py", line 126, in _validate_input 'was not defined' % arg) TaskotronYamlError: Required input arg envr was not defined
There has been no reply but AFAIK, this is fixed. If I'm wrong, please re-open
Login to comment on this ticket.