mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-02 16:53:11 +00:00
Fail with more meaningful message when the volume can not be found (#37508)
This commit is contained in:
committed by
Monty Taylor
parent
78023e79d7
commit
f488d3cf79
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user