diff options
author | Linda Wang <wangwulin@huawei.com> | 2017-05-18 08:35:48 +0000 |
---|---|---|
committer | Linda Wang <wangwulin@huawei.com> | 2017-05-18 08:37:01 +0000 |
commit | 1cbb37c19631f1b7602deeab6d2784c48484f1d0 (patch) | |
tree | 3c1a27bababdb1328f7b5d087ef3576780c3b8ad /functest/cli/commands/cli_os.py | |
parent | 57da7080488785813adcaff4e2410e2338dccf2a (diff) |
Replace CONST.* by getattribute/setattr for cli
Directories affected:
- functest/cli/commands
and respective unit test
JIRA: FUNCTEST-796
Change-Id: I2ad721819d4b8f97098c589c3b5ed3dcc945409d
Signed-off-by: Linda Wang <wangwulin@huawei.com>
Diffstat (limited to 'functest/cli/commands/cli_os.py')
-rw-r--r-- | functest/cli/commands/cli_os.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/functest/cli/commands/cli_os.py b/functest/cli/commands/cli_os.py index f85f4041..e54eb423 100644 --- a/functest/cli/commands/cli_os.py +++ b/functest/cli/commands/cli_os.py @@ -21,11 +21,11 @@ import functest.utils.openstack_snapshot as os_snapshot class CliOpenStack(object): def __init__(self): - self.os_auth_url = CONST.OS_AUTH_URL + self.os_auth_url = CONST.__getattribute__('OS_AUTH_URL') self.endpoint_ip = None self.endpoint_port = None - self.openstack_creds = CONST.openstack_creds - self.snapshot_file = CONST.openstack_snapshot_file + self.openstack_creds = CONST.__getattribute__('openstack_creds') + self.snapshot_file = CONST.__getattribute__('openstack_snapshot_file') if self.os_auth_url: self.endpoint_ip = self.os_auth_url.rsplit("/")[2].rsplit(":")[0] self.endpoint_port = self.os_auth_url.rsplit("/")[2].rsplit(":")[1] @@ -59,16 +59,16 @@ class CliOpenStack(object): else: answer = raw_input("Invalid answer. Please type [y|n]\n") - installer_type = CONST.INSTALLER_TYPE + installer_type = CONST.__getattribute__('INSTALLER_TYPE') if installer_type is None: click.echo("The environment variable 'INSTALLER_TYPE' is not" "defined. Please export it") - installer_ip = CONST.INSTALLER_IP + installer_ip = CONST.__getattribute__('INSTALLER_IP') if installer_ip is None: click.echo("The environment variable 'INSTALLER_IP' is not" "defined. Please export it") cmd = ("%s/releng/utils/fetch_os_creds.sh -d %s -i %s -a %s" - % (CONST.dir_repos, + % (CONST.__getattribute__('dir_repos'), self.openstack_creds, installer_type, installer_ip)) @@ -78,7 +78,8 @@ class CliOpenStack(object): def check(self): self.ping_endpoint() - cmd = CONST.dir_repo_functest + "/functest/ci/check_os.sh" + cmd = os.path.join(CONST.__getattribute__('dir_repo_functest'), + "functest/ci/check_os.sh") ft_utils.execute_command(cmd, verbose=False) def snapshot_create(self): |