aboutsummaryrefslogtreecommitdiffstats
path: root/functest/cli/commands/cli_os.py
diff options
context:
space:
mode:
authorCedric Ollivier <cedric.ollivier@orange.com>2017-08-17 11:12:52 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-08-17 11:12:52 +0000
commitf01fb5609298c7c4b0f19cfe8d54fc331dd5a0ad (patch)
tree36b2ffb2b8d56dfabe02b0e85ff30d3822fca51a /functest/cli/commands/cli_os.py
parentc582427bd2586347fd21bcee3b28a2f7e75faf3d (diff)
parentecaecd74a20e4845fb748077b759a5697ba86f1c (diff)
Merge "API proposal for functest"
Diffstat (limited to 'functest/cli/commands/cli_os.py')
-rw-r--r--functest/cli/commands/cli_os.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/functest/cli/commands/cli_os.py b/functest/cli/commands/cli_os.py
index f4ec1661..e97ab080 100644
--- a/functest/cli/commands/cli_os.py
+++ b/functest/cli/commands/cli_os.py
@@ -18,7 +18,7 @@ import functest.utils.openstack_clean as os_clean
import functest.utils.openstack_snapshot as os_snapshot
-class CliOpenStack(object):
+class OpenStack(object):
def __init__(self):
self.os_auth_url = CONST.__getattribute__('OS_AUTH_URL')
@@ -43,9 +43,11 @@ class CliOpenStack(object):
@staticmethod
def show_credentials():
+ dic_credentials = {}
for key, value in os.environ.items():
if key.startswith('OS_'):
- click.echo("{}={}".format(key, value))
+ dic_credentials.update({key: value})
+ return dic_credentials
def check(self):
self.ping_endpoint()
@@ -88,3 +90,16 @@ class CliOpenStack(object):
"'functest openstack snapshot-create'")
return
os_clean.main()
+
+
+class CliOpenStack(OpenStack):
+
+ def __init__(self):
+ super(CliOpenStack, self).__init__()
+
+ @staticmethod
+ def show_credentials():
+ dic_credentials = OpenStack.show_credentials()
+ for key, value in dic_credentials.items():
+ if key.startswith('OS_'):
+ click.echo("{}={}".format(key, value))