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.
LGTM
@fbo @tdecacqu hi guys, kindly asking for merge
lgtm
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 :)
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