From 2fef45e3019e9770684d4b2880084096577353e5 Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Tue, 17 Nov 2015 09:27:14 +0100 Subject: [PATCH] Allow passing --insecure to python client binaries This is needed when running tests against a deployment with insecure SSL. Change-Id: I837fd3107484aa50383f581553651a02e2e413aa --- tempest_lib/cli/base.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tempest_lib/cli/base.py b/tempest_lib/cli/base.py index a80c84b..d408869 100644 --- a/tempest_lib/cli/base.py +++ b/tempest_lib/cli/base.py @@ -86,10 +86,12 @@ class CLIClient(object): :param cli_dir: The path where the python client binaries are installed. defaults to /usr/bin :type cli_dir: string + :param insecure: if True, --insecure is passed to python client binaries. + :type insecure: boolean """ def __init__(self, username='', password='', tenant_name='', uri='', - cli_dir='', *args, **kwargs): + cli_dir='', insecure=False, *args, **kwargs): """Initialize a new CLIClient object.""" super(CLIClient, self).__init__() self.cli_dir = cli_dir if cli_dir else '/usr/bin' @@ -97,6 +99,7 @@ class CLIClient(object): self.tenant_name = tenant_name self.password = password self.uri = uri + self.insecure = insecure def nova(self, action, flags='', params='', fail_ok=False, endpoint_type='publicURL', merge_stderr=False): @@ -357,7 +360,10 @@ class CLIClient(object): self.tenant_name, self.password, self.uri)) - flags = creds + ' ' + flags + if self.insecure: + flags = creds + ' --insecure ' + flags + else: + flags = creds + ' ' + flags return execute(cmd, action, flags, params, fail_ok, merge_stderr, self.cli_dir)