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

This commit is contained in:
Jeffrey Zhang 2018-05-26 23:32:12 +08:00 committed by Monty Taylor
parent 78023e79d7
commit f488d3cf79

View file

@ -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: