Fail with more meaningful message when the volume can not be found (#37508)

pull/19446/merge
Jeffrey Zhang 7 years ago committed by Monty Taylor
parent 78023e79d7
commit f488d3cf79

@ -100,6 +100,10 @@ def main():
try: try:
server = cloud.get_server(module.params['server']) server = cloud.get_server(module.params['server'])
volume = cloud.get_volume(module.params['volume']) 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) dev = cloud.get_volume_attach_device(volume, server.id)
if module.check_mode: if module.check_mode:

Loading…
Cancel
Save