Add a missing command line option: --insecure
This option allows to disable SSL certificates validation in HTTPClient. Fixes bug 1153715 Change-Id: I2c5123c3b8482a932fa401c56827f1fffe9fa381
This commit is contained in:
parent
f96219d67a
commit
a13a87c7ef
quantumclient
@ -54,7 +54,8 @@ class ClientManager(object):
|
||||
username=None, password=None,
|
||||
region_name=None,
|
||||
api_version=None,
|
||||
auth_strategy=None
|
||||
auth_strategy=None,
|
||||
insecure=False
|
||||
):
|
||||
self._token = token
|
||||
self._url = url
|
||||
@ -67,6 +68,7 @@ class ClientManager(object):
|
||||
self._api_version = api_version
|
||||
self._service_catalog = None
|
||||
self._auth_strategy = auth_strategy
|
||||
self._insecure = insecure
|
||||
return
|
||||
|
||||
def initialize(self):
|
||||
@ -75,7 +77,8 @@ class ClientManager(object):
|
||||
tenant_name=self._tenant_name,
|
||||
password=self._password,
|
||||
region_name=self._region_name,
|
||||
auth_url=self._auth_url)
|
||||
auth_url=self._auth_url,
|
||||
insecure=self._insecure)
|
||||
httpclient.authenticate()
|
||||
# Populate other password flow attributes
|
||||
self._token = httpclient.auth_token
|
||||
|
@ -44,7 +44,8 @@ def make_client(instance):
|
||||
auth_url=instance._auth_url,
|
||||
endpoint_url=url,
|
||||
token=instance._token,
|
||||
auth_strategy=instance._auth_strategy)
|
||||
auth_strategy=instance._auth_strategy,
|
||||
insecure=instance._insecure)
|
||||
return client
|
||||
else:
|
||||
raise exceptions.UnsupportedVersion("API version %s is not supported" %
|
||||
|
@ -412,6 +412,15 @@ class QuantumShell(App):
|
||||
'--os_url',
|
||||
help=argparse.SUPPRESS)
|
||||
|
||||
parser.add_argument(
|
||||
'--insecure',
|
||||
action='store_true',
|
||||
default=env('QUANTUMCLIENT_INSECURE', default=False),
|
||||
help="Explicitly allow quantumclient to perform \"insecure\" "
|
||||
"SSL (https) requests. The server's certificate will "
|
||||
"not be verified against any certificate authorities. "
|
||||
"This option should be used with caution.")
|
||||
|
||||
return parser
|
||||
|
||||
def _bash_completion(self):
|
||||
@ -572,7 +581,8 @@ class QuantumShell(App):
|
||||
password=self.options.os_password,
|
||||
region_name=self.options.os_region_name,
|
||||
api_version=self.api_version,
|
||||
auth_strategy=self.options.os_auth_strategy, )
|
||||
auth_strategy=self.options.os_auth_strategy,
|
||||
insecure=self.options.insecure, )
|
||||
return
|
||||
|
||||
def initialize_app(self, argv):
|
||||
|
Loading…
x
Reference in New Issue
Block a user