diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-02-21 11:33:39 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-02-22 10:31:32 +0100 |
commit | fdbfe10922d09ee3dad407b10be0205082dddce3 (patch) | |
tree | 4e9045128181f4683f1918ed7ecebecdacd53387 /functest/api/resources/v1/creds.py | |
parent | 78a21107e377f4f4722fd8d570dc0394f6ae5692 (diff) |
Use constants for Functest config file
env_file can't be defined in a config file simply because it's an
entry point (Jenkins jobs, end users)
Change-Id: Ie23c0ef90efc839d60f0f3a9754c58746b1f3a00
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/api/resources/v1/creds.py')
-rw-r--r-- | functest/api/resources/v1/creds.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/functest/api/resources/v1/creds.py b/functest/api/resources/v1/creds.py index 25c0fd24..3eae1966 100644 --- a/functest/api/resources/v1/creds.py +++ b/functest/api/resources/v1/creds.py @@ -23,7 +23,7 @@ from functest.api.base import ApiResource from functest.api.common import api_utils from functest.ci import run_tests from functest.cli.commands.cli_os import OpenStack -from functest.utils.constants import CONST +from functest.utils import constants LOGGER = logging.getLogger(__name__) @@ -39,7 +39,7 @@ class V1Creds(ApiResource): endpoint='{0}/credentials'.format(ENDPOINT_CREDS)) def get(self): # pylint: disable=no-self-use """ Get credentials """ - run_tests.Runner.source_envfile(getattr(CONST, 'env_file')) + run_tests.Runner.source_envfile(constants.ENV_FILE) credentials_show = OpenStack.show_credentials() return jsonify(credentials_show) @@ -65,7 +65,7 @@ class V1Creds(ApiResource): lines = ['export {}={}\n'.format(k, v) for k, v in openrc_vars.items()] - rc_file = getattr(CONST, 'env_file') + rc_file = constants.ENV_FILE with open(rc_file, 'w') as creds_file: creds_file.writelines(lines) |