diff options
author | Cedric Ollivier <cedric.ollivier@orange.com> | 2017-05-17 11:46:38 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-05-17 11:46:38 +0000 |
commit | 0821c4204c7ca470818cfe1c83060fcd2f94e3d6 (patch) | |
tree | ef425cd77381d13d149be43ddc524b0c691770a5 /functest | |
parent | a3dd6167706695a73a72486a1217d32c76071592 (diff) | |
parent | f1dec639de47c632ebcf9acc4f7e74ed57979a6f (diff) |
Merge "Conform constants.py with the minimal standards"
Diffstat (limited to 'functest')
-rw-r--r--[-rwxr-xr-x] | functest/utils/config.py | 14 | ||||
-rw-r--r--[-rwxr-xr-x] | functest/utils/constants.py | 19 | ||||
-rw-r--r-- | functest/utils/env.py | 9 |
3 files changed, 21 insertions, 21 deletions
diff --git a/functest/utils/config.py b/functest/utils/config.py index b5b84501..d91f63ac 100755..100644 --- a/functest/utils/config.py +++ b/functest/utils/config.py @@ -1,8 +1,11 @@ -import os +#!/usr/bin/env python +import os import yaml -import env +import six + +from functest.utils import env class Config(object): @@ -16,7 +19,7 @@ class Config(object): self._set_others() def _parse(self, attr_now, left_parametes): - for param_n, param_v in left_parametes.iteritems(): + for param_n, param_v in six.iteritems(left_parametes): attr_further = self._get_attr_further(attr_now, param_n) if attr_further: self.__setattr__(attr_further, param_v) @@ -32,8 +35,3 @@ class Config(object): CONF = Config() - -if __name__ == "__main__": - print CONF.vnf_cloudify_ims - print CONF.vnf_cloudify_ims_tenant_images - print CONF.vnf_cloudify_ims_tenant_images_centos_7 diff --git a/functest/utils/constants.py b/functest/utils/constants.py index 2e8eb3f4..75c97c76 100755..100644 --- a/functest/utils/constants.py +++ b/functest/utils/constants.py @@ -1,20 +1,17 @@ -import config -import env +#!/usr/bin/env python + +import six + +from functest.utils import config +from functest.utils import env class Constants(object): def __init__(self): - for attr_n, attr_v in config.CONF.__dict__.iteritems(): + for attr_n, attr_v in six.iteritems(config.CONF.__dict__): self.__setattr__(attr_n, attr_v) - for env_n, env_v in env.ENV.__dict__.iteritems(): + for env_n, env_v in six.iteritems(env.ENV.__dict__): self.__setattr__(env_n, env_v) CONST = Constants() - -if __name__ == '__main__': - print CONST.__dict__ - print CONST.NODE_NAME - print CONST.vIMS_clearwater_blueprint_url - print CONST.vIMS_clearwater_blueprint_file_name - print CONST.vIMS_clearwater_blueprint_name diff --git a/functest/utils/env.py b/functest/utils/env.py index 7e4df2ea..c9629e15 100644 --- a/functest/utils/env.py +++ b/functest/utils/env.py @@ -1,6 +1,11 @@ +#!/usr/bin/env python + import os import re +import six + + default_envs = { 'NODE_NAME': 'unknown_pod', 'CI_DEBUG': 'false', @@ -17,9 +22,9 @@ default_envs = { class Environment(object): def __init__(self): - for k, v in os.environ.iteritems(): + for k, v in six.iteritems(os.environ): self.__setattr__(k, v) - for k, v in default_envs.iteritems(): + for k, v in six.iteritems(default_envs): if k not in os.environ: self.__setattr__(k, v) self._set_ci_run() |