#33 Check if task's input is a valid yaml file
Closed: Fixed Opened by mkrizek.

Passing task file as an empty file results in:

$ python runtask.py -e xchat-2.8.8-21.fc20 -a x86_64 empty_file
[libtaskotron:logger.py:61] 2014-02-25 15:52:33 DEBUG doing stream logging
[libtaskotron:logger.py:34] 2014-02-25 15:52:33 CRITICAL Traceback (most recent call last):
File "runtask.py", line 4, in
runner.main()
File "/home/mkrizek/devel/libtaskotron/libtaskotron/runner.py", line 134, in main
task_runner.run()
File "/home/mkrizek/devel/libtaskotron/libtaskotron/runner.py", line 27, in run
self._validate_input()
File "/home/mkrizek/devel/libtaskotron/libtaskotron/runner.py", line 102, in _validate_input
required_input = self.taskdata['input']['args'].split(',')
TypeError: 'NoneType' object has no attribute 'getitem'

Make sure that there is some kind of check that the input is a valid yaml file.


This ticket had assigned some Differential requests:
D20

There are a lot of places where input yaml should be validated. For example, I don't know whether "input:" is required, if it must have "args:" in it and so on. I think that the best way to do this is to use [[ http://rx.codesimply.com/ | Rx ]] and write schema for it. I have updated code to simply check presence of some items in provided yaml file. Please see [[ http://jsedlak.fedorapeople.org/0001-added-simple-yaml-validation.patch | my patch ]].

@jsedlak: When posting patches, please use Phabricator. See https://fedoraproject.org/wiki/User:Tflink/taskotron_contribution_guide

Metadata