3 # pylint: disable=missing-docstring
12 class Environment(object): # pylint: disable=too-few-public-methods
15 'NODE_NAME': 'unknown_pod',
17 'DEPLOY_SCENARIO': 'os-nosdn-nofeature-noha',
18 'DEPLOY_TYPE': 'virt',
19 'INSTALLER_TYPE': None,
22 'OS_ENDPOINT_TYPE': None,
24 'CONFIG_FUNCTEST_YAML': pkg_resources.resource_filename(
25 'functest', 'ci/config_functest.yaml'),
27 'OS_REGION_NAME': 'RegionOne'
31 for key, value in six.iteritems(os.environ):
32 setattr(self, key, value)
33 for key, value in six.iteritems(self.default_envs):
34 if key not in os.environ:
35 setattr(self, key, value)
37 if 'CI_LOOP' not in os.environ:
40 def _set_ci_run(self):
41 if getattr(self, "BUILD_TAG"):
42 setattr(self, "IS_CI_RUN", True)
44 setattr(self, "IS_CI_RUN", False)
46 def _set_ci_loop(self):
47 if (getattr(self, "BUILD_TAG") and
48 re.search("daily", getattr(self, "BUILD_TAG"))):
49 setattr(self, "CI_LOOP", "daily")
51 setattr(self, "CI_LOOP", "weekly")