Allow passing --insecure to python client binaries
This is needed when running tests against a deployment with insecure SSL. Change-Id: I837fd3107484aa50383f581553651a02e2e413aa
This commit is contained in:
@@ -86,10 +86,12 @@ class CLIClient(object):
|
|||||||
:param cli_dir: The path where the python client binaries are installed.
|
:param cli_dir: The path where the python client binaries are installed.
|
||||||
defaults to /usr/bin
|
defaults to /usr/bin
|
||||||
:type cli_dir: string
|
: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='',
|
def __init__(self, username='', password='', tenant_name='', uri='',
|
||||||
cli_dir='', *args, **kwargs):
|
cli_dir='', insecure=False, *args, **kwargs):
|
||||||
"""Initialize a new CLIClient object."""
|
"""Initialize a new CLIClient object."""
|
||||||
super(CLIClient, self).__init__()
|
super(CLIClient, self).__init__()
|
||||||
self.cli_dir = cli_dir if cli_dir else '/usr/bin'
|
self.cli_dir = cli_dir if cli_dir else '/usr/bin'
|
||||||
@@ -97,6 +99,7 @@ class CLIClient(object):
|
|||||||
self.tenant_name = tenant_name
|
self.tenant_name = tenant_name
|
||||||
self.password = password
|
self.password = password
|
||||||
self.uri = uri
|
self.uri = uri
|
||||||
|
self.insecure = insecure
|
||||||
|
|
||||||
def nova(self, action, flags='', params='', fail_ok=False,
|
def nova(self, action, flags='', params='', fail_ok=False,
|
||||||
endpoint_type='publicURL', merge_stderr=False):
|
endpoint_type='publicURL', merge_stderr=False):
|
||||||
@@ -357,6 +360,9 @@ class CLIClient(object):
|
|||||||
self.tenant_name,
|
self.tenant_name,
|
||||||
self.password,
|
self.password,
|
||||||
self.uri))
|
self.uri))
|
||||||
|
if self.insecure:
|
||||||
|
flags = creds + ' --insecure ' + flags
|
||||||
|
else:
|
||||||
flags = creds + ' ' + flags
|
flags = creds + ' ' + flags
|
||||||
return execute(cmd, action, flags, params, fail_ok, merge_stderr,
|
return execute(cmd, action, flags, params, fail_ok, merge_stderr,
|
||||||
self.cli_dir)
|
self.cli_dir)
|
||||||
|
Reference in New Issue
Block a user