Commit a21440d8 authored by Helga Velroyen's avatar Helga Velroyen
Browse files

Correct test for existance of instances



Since python interprets an empty dictionary as 'False',
testing for the existance of the 'instances' field in
the configuration has to be done by explicitely testing
for 'None'.
Signed-off-by: default avatarHelga Velroyen <helgav@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 514dcbda
...@@ -413,7 +413,7 @@ def DowngradeCluster(config_data): ...@@ -413,7 +413,7 @@ def DowngradeCluster(config_data):
def DowngradeInstances(config_data): def DowngradeInstances(config_data):
instances = config_data.get("instances", None) instances = config_data.get("instances", None)
if not instances: if instances is None:
raise Error("Cannot find the 'instances' key in the configuration") raise Error("Cannot find the 'instances' key in the configuration")
for (_, iobj) in instances.items(): for (_, iobj) in instances.items():
if "osparams_private" in iobj: if "osparams_private" in iobj:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment