PR to fix if equals error code command is not found (#62539)

* fix if equals error code if command not found (#62529)


(cherry picked from commit 55f285a384)

* changelog
pull/62541/head
Sumit Jaiswal 5 years ago committed by Toshio Kuratomi
parent 26a615a6f8
commit 45f573d2ed

@ -0,0 +1,3 @@
---
bugfixes:
- "fix if equals error code command is not found(https://github.com/ansible/ansible/pull/62529)"

@ -364,6 +364,8 @@ def api_call_for_rule(module, api_call_object):
# if code is 400 (bad request) or 500 (internal error) - fail # if code is 400 (bad request) or 500 (internal error) - fail
if equals_code == 400 or equals_code == 500: if equals_code == 400 or equals_code == 500:
module.fail_json(msg=equals_response) module.fail_json(msg=equals_response)
if equals_code == 404 and equals_response['code'] == 'generic_err_command_not_found':
module.fail_json(msg='Relevant hotfix is not installed on Check Point server. See sk114661 on Check Point Support Center.')
if module.params['state'] == 'present': if module.params['state'] == 'present':
if equals_code == 200: if equals_code == 200:

Loading…
Cancel
Save