Fail with more meaningful message when the volume can not be found (#37508)
This commit is contained in:
parent
78023e79d7
commit
f488d3cf79
1 changed files with 4 additions and 0 deletions
|
@ -100,6 +100,10 @@ def main():
|
|||
try:
|
||||
server = cloud.get_server(module.params['server'])
|
||||
volume = cloud.get_volume(module.params['volume'])
|
||||
|
||||
if not volume:
|
||||
module.fail_json(msg='volume %s is not found' % module.params['volume'])
|
||||
|
||||
dev = cloud.get_volume_attach_device(volume, server.id)
|
||||
|
||||
if module.check_mode:
|
||||
|
|
Loading…
Reference in a new issue