Merge "Don't create envvars cloud if cloud or region are set"

This commit is contained in:
Jenkins 2016-10-12 23:49:57 +00:00 committed by Gerrit Code Review
commit 3777f11003
1 changed files with 5 additions and 6 deletions

View File

@ -105,12 +105,11 @@ def _get_os_environ(envvar_prefix=None):
for k in environkeys:
newkey = k.split('_', 1)[-1].lower()
ret[newkey] = os.environ[k]
# If the only environ key is region name, don't make a cloud, because
# it's being used as a cloud selector
if not environkeys or (
len(environkeys) == 1 and 'region_name' in ret):
return None
return ret
# If the only environ keys are cloud and region_name, don't return anything
# because they are cloud selectors
if set(environkeys) - set(['OS_CLOUD', 'OS_REGION_NAME']):
return ret
return None
def _merge_clouds(old_dict, new_dict):