From 2f2739f9a190e9f5a9325234ba069d34b9b9d973 Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Wed, 28 Mar 2018 18:54:03 +0300 Subject: [PATCH] Fix obtaining env_uuid from deployment This patch fixes a check for DEPLOYMENT_UUID in case of missing ENV_UUID. Instead of checking system environment directly, we should call get_global method which loads our source file with default UUIDs. Change-Id: I2314b758339edfe77e1536c37dcdb54af1b6a581 --- rally/cli/envutils.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rally/cli/envutils.py b/rally/cli/envutils.py index 39bf5b5d05..a12f7558ae 100644 --- a/rally/cli/envutils.py +++ b/rally/cli/envutils.py @@ -74,9 +74,10 @@ def with_default_env(): # NOTE(boris-42): This allows smooth transition from deployment to env # set ENV_ENV from ENV_DEPLOYMENT if ENV is not presented # This should be removed with rally env command - if not os.environ.get(ENV_ENV): - if os.environ.get(ENV_DEPLOYMENT): - os.environ[ENV_ENV] = ENV_DEPLOYMENT + if not get_global(ENV_ENV): + deployment = get_global(ENV_DEPLOYMENT) + if deployment: + os.environ[ENV_ENV] = deployment return default_from_global( "env", ENV_ENV, "env", @@ -89,9 +90,10 @@ def with_default_deployment(cli_arg_name="uuid"): # NOTE(boris-42): This allows smooth transition from deployment to env # set ENV_ENV from ENV_DEPLOYMENT and use ENV_ENV # This should be removed with rally env command - if not os.environ.get(ENV_ENV): - if os.environ.get(ENV_DEPLOYMENT): - os.environ[ENV_ENV] = ENV_DEPLOYMENT + if not get_global(ENV_ENV): + deployment = get_global(ENV_DEPLOYMENT) + if deployment: + os.environ[ENV_ENV] = deployment return default_from_global( "deployment", ENV_ENV, cli_arg_name,