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
This commit is contained in:
Andrey Kurilin 2018-03-28 18:54:03 +03:00
parent 899bffe399
commit 2f2739f9a1

View File

@ -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,