diff --git a/manila/share/drivers/quobyte/jsonrpc.py b/manila/share/drivers/quobyte/jsonrpc.py index f06854aa44..05bc04fc40 100644 --- a/manila/share/drivers/quobyte/jsonrpc.py +++ b/manila/share/drivers/quobyte/jsonrpc.py @@ -61,9 +61,9 @@ class HTTPSConnectionWithCaVerification(http_client.HTTPConnection): default_port = http_client.HTTPS_PORT def __init__(self, host, port=None, key_file=None, cert_file=None, - ca_file=None, strict=None, + ca_file=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): - http_client.HTTPConnection.__init__(self, host, port, strict, timeout) + http_client.HTTPConnection.__init__(self, host, port, timeout=timeout) self.key_file = key_file self.cert_file = cert_file self.ca_file = ca_file diff --git a/manila/tests/share/drivers/quobyte/test_jsonrpc.py b/manila/tests/share/drivers/quobyte/test_jsonrpc.py index a17cf8498a..b24c54f9f1 100644 --- a/manila/tests/share/drivers/quobyte/test_jsonrpc.py +++ b/manila/tests/share/drivers/quobyte/test_jsonrpc.py @@ -61,7 +61,6 @@ class QuobyteHttpsConnectionWithCaVerificationTestCase(test.TestCase): key_file=key_file, cert_file=cert_file, ca_file=ca_file, - strict="anything", port=1234, timeout=999)) @@ -90,7 +89,6 @@ class QuobyteHttpsConnectionWithCaVerificationTestCase(test.TestCase): key_file=key_file, cert_file=cert_file, ca_file=ca_file, - strict="anything", port=1234, timeout=999)) mycon._tunnel_host = "fake_tunnel_host" @@ -180,13 +178,17 @@ class QuobyteJsonRpcTestCase(test.TestCase): self.rpc._connection, 'request', mock.Mock(side_effect=ssl.SSLError)) + self.mock_object( + self.rpc._connection, + 'getresponse', + mock.Mock(return_value=FakeResponse( + 403, '{"error":{"code":28,"message":"text"}}'))) self.mock_object(jsonrpc.LOG, 'warning') - self.mock_object(http_client, 'HTTPSConnection') self.assertRaises(exception.QBException, self.rpc.call, 'method', {'param': 'value'}) - http_client.HTTPSConnection.assert_called_once_with(self.rpc._netloc) + self.assertTrue(self.rpc._disabled_cert_verification) jsonrpc.LOG.warning.assert_called_once_with( "Could not verify server certificate of "