aboutsummaryrefslogtreecommitdiffstats
path: root/functest/utils/constants.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-02-14 16:02:53 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-02-16 10:24:22 +0100
commitd589e4e5345ed82c68d9a011ac89f8cdbefe2ca3 (patch)
tree1ec221f1f95e6abaec9b1465e9e46b76f8777a27 /functest/utils/constants.py
parent98e2806cb674d206dea65647c0644dc5b2871b4b (diff)
Get properly env vars or their default values
It defines env.get() as an unique way to get Functest env vars or their default values. It can be considered as a wrapper above os.environ. It enforces backward compatibility via CONST which mustn't be used for that purpose. It should be noted that it also stops using CONST for getting OpenStack env vars. Change-Id: I333dc1afbc0123166a7eaff8b551370098efa341 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/utils/constants.py')
-rw-r--r--functest/utils/constants.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/functest/utils/constants.py b/functest/utils/constants.py
index c19e0fc5..d8a1d54d 100644
--- a/functest/utils/constants.py
+++ b/functest/utils/constants.py
@@ -2,6 +2,7 @@
# pylint: disable=missing-docstring
+import pkg_resources
import six
from functest.utils import config
@@ -10,6 +11,9 @@ from functest.utils import env
class Constants(object): # pylint: disable=too-few-public-methods
+ CONFIG_FUNCTEST_YAML = pkg_resources.resource_filename(
+ 'functest', 'ci/config_functest.yaml')
+
def __init__(self):
for attr_n, attr_v in six.iteritems(config.CONF.__dict__):
setattr(self, attr_n, attr_v)