Verify image exists when passed for server creation
If the image doesn't exist, we should fail and raise the error clearly. Fixes #18921
This commit is contained in:
parent
1da6a67c50
commit
6d32dba3c3
1 changed files with 3 additions and 0 deletions
|
@ -447,6 +447,9 @@ def _create_server(module, cloud):
|
|||
if not module.params['boot_volume']:
|
||||
image_id = cloud.get_image_id(
|
||||
module.params['image'], module.params['image_exclude'])
|
||||
if not image_id:
|
||||
module.fail_json(msg="Could not find image %s" %
|
||||
module.params['image'])
|
||||
|
||||
if flavor:
|
||||
flavor_dict = cloud.get_flavor(flavor)
|
||||
|
|
Loading…
Reference in a new issue