Fix get_flavor_id() when flavor_ram is specified
Without this fix, _get_flavor_id() fails to find a matching flavor if both: * the flavor_ram parameter is specified * the first flavor in the list does not match. The bug is simply that the module.fail_json() call lies within the loop iterating through the flavors. This call should only be made if the loop completes and no matching flavors have been found.
This commit is contained in:
parent
5d16410518
commit
dd78dde449
1 changed files with 1 additions and 1 deletions
|
@ -405,7 +405,7 @@ def _get_flavor_id(module, nova):
|
||||||
if (flavor.ram >= module.params['flavor_ram'] and
|
if (flavor.ram >= module.params['flavor_ram'] and
|
||||||
(not module.params['flavor_include'] or module.params['flavor_include'] in flavor.name)):
|
(not module.params['flavor_include'] or module.params['flavor_include'] in flavor.name)):
|
||||||
return flavor.id
|
return flavor.id
|
||||||
module.fail_json(msg = "Error finding flavor with %sMB of RAM" % module.params['flavor_ram'])
|
module.fail_json(msg = "Error finding flavor with %sMB of RAM" % module.params['flavor_ram'])
|
||||||
return module.params['flavor_id']
|
return module.params['flavor_id']
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue