Merge pull request #2022 from pwnall/patch-1
os_server: nice error when flavor not found
This commit is contained in:
commit
089dcbf437
1 changed files with 4 additions and 0 deletions
|
@ -287,8 +287,12 @@ def _create_server(module, cloud):
|
||||||
|
|
||||||
if flavor:
|
if flavor:
|
||||||
flavor_dict = cloud.get_flavor(flavor)
|
flavor_dict = cloud.get_flavor(flavor)
|
||||||
|
if not flavor_dict:
|
||||||
|
module.fail_json(msg="Could not find flavor %s" % flavor)
|
||||||
else:
|
else:
|
||||||
flavor_dict = cloud.get_flavor_by_ram(flavor_ram, flavor_include)
|
flavor_dict = cloud.get_flavor_by_ram(flavor_ram, flavor_include)
|
||||||
|
if not flavor_dict:
|
||||||
|
module.fail_json(msg="Could not find any matching flavor")
|
||||||
|
|
||||||
nics = _network_args(module, cloud)
|
nics = _network_args(module, cloud)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue