aboutsummaryrefslogtreecommitdiffstats
path: root/functest/cli/commands
diff options
context:
space:
mode:
Diffstat (limited to 'functest/cli/commands')
-rw-r--r--functest/cli/commands/cli_env.py22
-rw-r--r--functest/cli/commands/cli_os.py4
-rw-r--r--functest/cli/commands/cli_tier.py6
3 files changed, 13 insertions, 19 deletions
diff --git a/functest/cli/commands/cli_env.py b/functest/cli/commands/cli_env.py
index c1b66da4..a5c0e399 100644
--- a/functest/cli/commands/cli_env.py
+++ b/functest/cli/commands/cli_env.py
@@ -8,11 +8,10 @@
# pylint: disable=missing-docstring
+import os
+
import click
import prettytable
-
-from functest.utils.constants import CONST
-
import six
@@ -20,24 +19,19 @@ class Env(object): # pylint: disable=too-few-public-methods
@staticmethod
def show():
- def _get_value(attr, default='Unknown'):
- return attr if attr else default
-
- install_type = _get_value(CONST.__getattribute__('INSTALLER_TYPE'))
- installer_ip = _get_value(CONST.__getattribute__('INSTALLER_IP'))
+ install_type = os.environ.get('INSTALLER_TYPE', 'Unknown')
+ installer_ip = os.environ.get('INSTALLER_IP', 'Unknown')
installer_info = ("%s, %s" % (install_type, installer_ip))
- scenario = _get_value(CONST.__getattribute__('DEPLOY_SCENARIO'))
- node = _get_value(CONST.__getattribute__('NODE_NAME'))
- is_debug = _get_value(CONST.__getattribute__('CI_DEBUG'), 'false')
- build_tag = CONST.__getattribute__('BUILD_TAG')
- if build_tag is not None:
+ scenario = os.environ.get('DEPLOY_SCENARIO', 'Unknown')
+ node = os.environ.get('NODE_NAME', 'Unknown')
+ build_tag = os.environ.get('BUILD_TAG', None)
+ if build_tag:
build_tag = build_tag.lstrip(
"jenkins-").lstrip("functest").lstrip("-")
env_info = {'INSTALLER': installer_info,
'SCENARIO': scenario,
'POD': node,
- 'DEBUG FLAG': is_debug,
'BUILD_TAG': build_tag}
return env_info
diff --git a/functest/cli/commands/cli_os.py b/functest/cli/commands/cli_os.py
index 7595caab..0cf28623 100644
--- a/functest/cli/commands/cli_os.py
+++ b/functest/cli/commands/cli_os.py
@@ -20,10 +20,10 @@ from functest.utils.constants import CONST
class OpenStack(object):
def __init__(self):
- self.os_auth_url = CONST.__getattribute__('OS_AUTH_URL')
+ self.os_auth_url = os.environ['OS_AUTH_URL']
self.endpoint_ip = None
self.endpoint_port = None
- self.openstack_creds = CONST.__getattribute__('env_file')
+ self.openstack_creds = getattr(CONST, 'env_file')
if self.os_auth_url:
self.endpoint_ip = urllib.parse.urlparse(self.os_auth_url).hostname
self.endpoint_port = urllib.parse.urlparse(self.os_auth_url).port
diff --git a/functest/cli/commands/cli_tier.py b/functest/cli/commands/cli_tier.py
index 7aa3f714..933d8cd6 100644
--- a/functest/cli/commands/cli_tier.py
+++ b/functest/cli/commands/cli_tier.py
@@ -8,12 +8,12 @@
# pylint: disable=missing-docstring
+import os
import pkg_resources
import click
from functest.ci import tier_builder
-from functest.utils.constants import CONST
from functest.utils import functest_utils
@@ -21,8 +21,8 @@ class Tier(object):
def __init__(self):
self.tiers = tier_builder.TierBuilder(
- CONST.__getattribute__('INSTALLER_TYPE'),
- CONST.__getattribute__('DEPLOY_SCENARIO'),
+ os.environ['INSTALLER_TYPE'],
+ os.environ['DEPLOY_SCENARIO'],
pkg_resources.resource_filename('functest', 'ci/testcases.yaml'))
def list(self):