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:
parent
e861195773
commit
178811d174
1 changed files with 2 additions and 0 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue