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']:
|
if module.params['volume_src']:
|
||||||
volume_id = cloud.get_volume_id(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_args['source_volid'] = volume_id
|
||||||
|
|
||||||
volume = cloud.create_volume(
|
volume = cloud.create_volume(
|
||||||
|
|
Loading…
Reference in a new issue