Fix up client init

Commit c9114b7eb8 introduced a critical
bug where service_type is not being passed through to the client making
it fail.

Change-Id: I6c19199785109cacef6d8b06e08d926efc6d4890
Closes-Bug: #1942330
changes/07/807007/3 3.3.1
Sam Morrison 1 year ago committed by Pierre Riteau
parent d2eb2f6583
commit cfabd241df
  1. 4
      blazarclient/client.py
  2. 6
      blazarclient/tests/test_client.py

@ -34,4 +34,6 @@ def Client(version=1, service_type='reservation', *args, **kwargs):
})
raise exception.UnsupportedVersion(msg)
return importutils.import_object(client_path, *args, **kwargs)
return importutils.import_object(client_path,
service_type=service_type,
*args, **kwargs)

@ -32,12 +32,14 @@ class BaseClientTestCase(tests.TestCase):
def test_with_v1(self):
self.client.Client()
self.import_obj.assert_called_once_with(
'blazarclient.v1.client.Client')
'blazarclient.v1.client.Client',
service_type='reservation')
def test_with_v1a0(self):
self.client.Client(version='1a0')
self.import_obj.assert_called_once_with(
'blazarclient.v1.client.Client')
'blazarclient.v1.client.Client',
service_type='reservation')
def test_with_wrong_vers(self):
self.assertRaises(exception.UnsupportedVersion,

Loading…
Cancel
Save