diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2016-10-18 17:38:15 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2016-10-19 09:23:43 +0200 |
commit | b6a48291841518b997cd9444df3f78e16f9a2654 (patch) | |
tree | d8f0adc38c78650cd457fb0f0198dc8b7ba50bea /cli | |
parent | 2aa78bdb5b21ac54b2f1183001c7466e59952c29 (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')
-rw-r--r-- | cli/commands/cli_os.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/commands/cli_os.py b/cli/commands/cli_os.py index 3748c212..2f3f329f 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): |