Make sure heat works with novaclient 7.0.0
This changes: 1. use 'endpoint_type' instead of 'interface' while init novaclient, because novaclient has deprecated the name 'interface', still use 'endpoint_type', details see: https://github.com/openstack/python-novaclient/blob/master/novaclient/client.py#L312-L327 2. novaclient has deleted HttpClient staff, change FakeClient for nova tests to use SessionClient instead. Change-Id: I5519b8fbf9983cc371bbc260e888c1dcbcd35af1 Closes-Bug: #1652224
This commit is contained in:
parent
315bf094fc
commit
18178ce0ac
|
@ -80,7 +80,7 @@ class NovaClientPlugin(client_plugin.ClientPlugin):
|
|||
args = {
|
||||
'session': self.context.keystone_session,
|
||||
'extensions': extensions,
|
||||
'interface': endpoint_type,
|
||||
'endpoint_type': endpoint_type,
|
||||
'service_type': self.COMPUTE,
|
||||
'region_name': self._get_region_name(),
|
||||
'http_log_debug': self._get_client_option(CLIENT_NAME,
|
||||
|
|
|
@ -39,19 +39,17 @@ def fake_exception(status_code=404, message=None, details=None):
|
|||
class FakeClient(fakes.FakeClient, Client):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(FakeClient, self).__init__('username', 'password', 'project_id',
|
||||
'auth_url', direct_use=False)
|
||||
self.client = FakeHTTPClient(**kwargs)
|
||||
super(FakeClient, self).__init__(direct_use=False)
|
||||
self.client = FakeSessionClient(session=mock.Mock(), **kwargs)
|
||||
|
||||
|
||||
class FakeHTTPClient(base_client.HTTPClient):
|
||||
class FakeSessionClient(base_client.SessionClient):
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(FakeHTTPClient, self).__init__('username', 'password',
|
||||
'project_id', 'auth_url')
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(FakeSessionClient, self).__init__(*args, **kwargs)
|
||||
self.callstack = []
|
||||
|
||||
def _cs_request(self, url, method, **kwargs):
|
||||
def request(self, url, method, **kwargs):
|
||||
# Check that certain things are called correctly
|
||||
if method in ['GET', 'DELETE']:
|
||||
assert 'body' not in kwargs
|
||||
|
|
Loading…
Reference in New Issue