Do not fail when action is delete and volume is not present

This prevents failing when a playbook describes a volume deletion and
is launched more that once.

Without this fix, if you run the playbook a second time, it will fail.
This commit is contained in:
Vincent VAN HOLLEBEKE 2016-01-24 20:28:01 +01:00
parent d02e26c38f
commit ce3e972ce8

View file

@ -433,7 +433,7 @@ def main():
else: else:
module.fail_json(msg='failed to create volume %s' % volume_name) module.fail_json(msg='failed to create volume %s' % volume_name)
if volume_name not in volumes: if action != 'delete' and volume_name not in volumes:
module.fail_json(msg='volume not found %s' % volume_name) module.fail_json(msg='volume not found %s' % volume_name)
if action == 'started': if action == 'started':