Merge pull request #19653 from Thingee/verify_openstack_images

Verify image exists when passed for open stack server creation
This commit is contained in:
Monty Taylor 2016-12-26 13:15:20 -06:00 committed by GitHub
commit 0bb7149e17

View file

@ -447,6 +447,9 @@ def _create_server(module, cloud):
if not module.params['boot_volume']: if not module.params['boot_volume']:
image_id = cloud.get_image_id( image_id = cloud.get_image_id(
module.params['image'], module.params['image_exclude']) 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: if flavor:
flavor_dict = cloud.get_flavor(flavor) flavor_dict = cloud.get_flavor(flavor)