mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Resolves handling of error and failure scenarios from Checkpoint module end (#54890)
* handle failure case Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com> * handle failure case Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com> * handle failure case Signed-off-by: Sumit Jaiswal <sjaiswal@redhat.com>
This commit is contained in:
@@ -104,7 +104,8 @@ def main():
|
||||
code, response = connection.send_request('/web_api/publish', payload)
|
||||
else:
|
||||
code, response = connection.send_request('/web_api/discard', payload)
|
||||
|
||||
if code != 200:
|
||||
module.fail_json(msg=response)
|
||||
result['checkpoint_session'] = response
|
||||
else:
|
||||
module.fail_json(msg='Check Point device returned error {0} with message {1}'.format(code, response))
|
||||
|
||||
Reference in New Issue
Block a user