#159 roles/testing-farm*: handle non json output
Merged by zuul. Opened by mvadkert.
mvadkert/fedora-zuul-jobs TFT-1553  into  master

Download 159.patch

Obviously it can happen the response is invalid and it
is not a valid json, so add a check to make sure we process
only json output.

Resolves TFT-1553

Related to https://centos.softwarefactory-project.io/zuul/t/centos/build/7da5eeee4b34470c92b4bd59b4ca54cf/console

Signed-off-by: Miroslav Vadkerti mvadkert@redhat.com

Tested manually via:

❯ ansible -c localhost -m debug -e '{ "response": { "tutu": { "state": "complete" }}}' -a "msg={{ 'json' in response and (response.json.state == 'complete' or response.json.state == 'error') }}" localhost
localhost | SUCCESS => {
    "msg": false
}
❯ ansible -c localhost -m debug -e '{ "response": { "json": { "state": "complete" }}}' -a "msg={{ 'json' in response and (response.json.state == 'complete' or response.json.state == 'error') }}" localhost
localhost | SUCCESS => {
    "msg": true
}

Build succeeded.

@fbo @tdecacqu hi guys, kindly asking for merge

Build succeeded.

Metadata Update from @tdecacqu:
- Pull-request tagged with: gateit

Build succeeded (gate pipeline).

Pull-Request has been merged by zuul

@mvadkert thanks for the ping, it should be good now

Oh, thanks, I completely forgot about that tag, next time :)

Metadata