From b6a48291841518b997cd9444df3f78e16f9a2654 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Tue, 18 Oct 2016 17:38:15 +0200 Subject: Get OS_ env vars via os.environ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It simply avoids executing env and grep. JIRA: FUNCTEST-271 Change-Id: If71aeb9c7b10df5dca54ca9cbc35ba5e6b5ebef4 Signed-off-by: Cédric Ollivier --- cli/commands/cli_os.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/commands') 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): -- cgit 1.2.3-korg