1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Return an error if volume_src wasn't found

This commit is contained in:
Simon Li 2016-10-06 14:00:38 +01:00 committed by ansible
parent e861195773
commit 178811d174

View file

@ -116,6 +116,8 @@ def _present_volume(module, cloud):
if module.params['volume_src']:
volume_id = cloud.get_volume_id(module.params['volume_src'])
if not volume_id:
module.fail_json(msg="Failed to find volume source '%s'" % module.params['volume_src'])
volume_args['source_volid'] = volume_id
volume = cloud.create_volume(