diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2017-05-19 08:34:18 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-05-19 08:34:18 +0000 |
commit | 167b2c84d1d9bede32c17354139ac91e86d85d7d (patch) | |
tree | b803d5bfb01b8c410c9ae205a68fb0545f0d3a64 /functest/cli/commands/cli_os.py | |
parent | 2d0027b13ed1a5a6f35666b2b74be0fc8b4f7b5f (diff) | |
parent | 1cbb37c19631f1b7602deeab6d2784c48484f1d0 (diff) |
Merge "Replace CONST.* by getattribute/setattr for cli"
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): |