mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-30 21:09:09 -07: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:
parent
56ae8ebd60
commit
0ff689a315
3 changed files with 16 additions and 7 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue