aboutsummaryrefslogtreecommitdiffstats
path: root/functest/api/resources/v1
diff options
context:
space:
mode:
Diffstat (limited to 'functest/api/resources/v1')
-rw-r--r--functest/api/resources/v1/creds.py4
-rw-r--r--functest/api/resources/v1/tasks.py2
-rw-r--r--functest/api/resources/v1/testcases.py10
3 files changed, 8 insertions, 8 deletions
diff --git a/functest/api/resources/v1/creds.py b/functest/api/resources/v1/creds.py
index fefbbaa9..25c0fd24 100644
--- a/functest/api/resources/v1/creds.py
+++ b/functest/api/resources/v1/creds.py
@@ -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(CONST.__getattribute__('env_file'))
+ run_tests.Runner.source_envfile(getattr(CONST, '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 = CONST.__getattribute__('env_file')
+ rc_file = getattr(CONST, 'env_file')
with open(rc_file, 'w') as creds_file:
creds_file.writelines(lines)
diff --git a/functest/api/resources/v1/tasks.py b/functest/api/resources/v1/tasks.py
index 6bf625a8..5af8a678 100644
--- a/functest/api/resources/v1/tasks.py
+++ b/functest/api/resources/v1/tasks.py
@@ -85,7 +85,7 @@ class V1TaskLog(ApiResource):
except ValueError:
return api_utils.result_handler(status=1, data='No such task id')
- task_log_dir = CONST.__getattribute__('dir_results')
+ task_log_dir = getattr(CONST, 'dir_results')
# pylint: disable=maybe-no-member
index = int(self._get_args().get('index', 0))
diff --git a/functest/api/resources/v1/testcases.py b/functest/api/resources/v1/testcases.py
index 01571548..bc21c6fa 100644
--- a/functest/api/resources/v1/testcases.py
+++ b/functest/api/resources/v1/testcases.py
@@ -127,10 +127,10 @@ class V1Testcase(ApiResource):
result = 'FAIL'
env_info = {
- 'installer': CONST.__getattribute__('INSTALLER_TYPE'),
- 'scenario': CONST.__getattribute__('DEPLOY_SCENARIO'),
- 'build_tag': CONST.__getattribute__('BUILD_TAG'),
- 'ci_loop': CONST.__getattribute__('CI_LOOP')
+ 'installer': os.environ.get('INSTALLER_TYPE', None),
+ 'scenario': os.environ.get('DEPLOY_SCENARIO', None),
+ 'build_tag': os.environ.get('BUILD_TAG', None),
+ 'ci_loop': os.environ.get('CI_LOOP', 'daily')
}
result = {
'task_id': args.get('task_id'),
@@ -146,7 +146,7 @@ class V1Testcase(ApiResource):
config = ConfigParser.RawConfigParser()
config.read(
pkg_resources.resource_filename('functest', 'ci/logging.ini'))
- log_path = os.path.join(CONST.__getattribute__('dir_results'),
+ log_path = os.path.join(getattr(CONST, 'dir_results'),
'{}.log'.format(task_id))
config.set('handler_file', 'args', '("{}",)'.format(log_path))