summaryrefslogtreecommitdiffstats
path: root/cli/commands/cli_os.py
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2016-10-18 17:38:15 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2016-10-19 09:23:43 +0200
commitb6a48291841518b997cd9444df3f78e16f9a2654 (patch)
treed8f0adc38c78650cd457fb0f0198dc8b7ba50bea /cli/commands/cli_os.py
parent2aa78bdb5b21ac54b2f1183001c7466e59952c29 (diff)
Get OS_ env vars via os.environ
It simply avoids executing env and grep. JIRA: FUNCTEST-271 Change-Id: If71aeb9c7b10df5dca54ca9cbc35ba5e6b5ebef4 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'cli/commands/cli_os.py')
-rw-r--r--cli/commands/cli_os.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/commands/cli_os.py b/cli/commands/cli_os.py
index 3748c212a..2f3f329f3 100644
--- a/cli/commands/cli_os.py
+++ b/cli/commands/cli_os.py
@@ -46,9 +46,9 @@ class CliOpenStack:
exit(0)
def show_credentials(self):
- cmd = "env|grep OS_"
- ft_utils.execute_command(cmd, verbose=False)
- click.echo("")
+ for key, value in os.environ.items():
+ if key.startswith('OS_'):
+ click.echo("{}={}".format(key, value))
def fetch_credentials(self):
if os.path.isfile(RC_FILE):