mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
Make purefa_pgsnap module handle its own exit correctly (#56954)
This commit is contained in:
@@ -235,8 +235,12 @@ def main():
|
|||||||
module.fail_json(msg="Selected volume {0} does not exist in the Protection Group".format(module.params['name']))
|
module.fail_json(msg="Selected volume {0} does not exist in the Protection Group".format(module.params['name']))
|
||||||
if ":" in module.params['name']:
|
if ":" in module.params['name']:
|
||||||
rvolume = get_rpgsnapshot(module, array)
|
rvolume = get_rpgsnapshot(module, array)
|
||||||
|
if rvolume is None:
|
||||||
|
module.fail_json(msg="Selected restore snapshot {0} does not exist in the Protection Group".format(module.params['restore']))
|
||||||
else:
|
else:
|
||||||
rvolume = get_pgroupvolume(module, array)
|
rvolume = get_pgroupvolume(module, array)
|
||||||
|
if rvolume is None:
|
||||||
|
module.fail_json(msg="Selected restore volume {0} does not exist in the Protection Group".format(module.params['restore']))
|
||||||
|
|
||||||
if state == 'copy' and rvolume:
|
if state == 'copy' and rvolume:
|
||||||
restore_pgsnapvolume(module, array)
|
restore_pgsnapvolume(module, array)
|
||||||
@@ -251,6 +255,8 @@ def main():
|
|||||||
elif state == 'absent' and not pgsnap:
|
elif state == 'absent' and not pgsnap:
|
||||||
module.exit_json(changed=False)
|
module.exit_json(changed=False)
|
||||||
|
|
||||||
|
module.exit_json(changed=False)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
|||||||
Reference in New Issue
Block a user