Merge "Make sure heat works with novaclient 7.0.0"

This commit is contained in:
Jenkins 2016-12-29 11:24:33 +00:00 committed by Gerrit Code Review
commit 1413e9d344
2 changed files with 7 additions and 9 deletions

View File

@ -80,7 +80,7 @@ class NovaClientPlugin(client_plugin.ClientPlugin):
args = { args = {
'session': self.context.keystone_session, 'session': self.context.keystone_session,
'extensions': extensions, 'extensions': extensions,
'interface': endpoint_type, 'endpoint_type': endpoint_type,
'service_type': self.COMPUTE, 'service_type': self.COMPUTE,
'region_name': self._get_region_name(), 'region_name': self._get_region_name(),
'http_log_debug': self._get_client_option(CLIENT_NAME, 'http_log_debug': self._get_client_option(CLIENT_NAME,

View File

@ -39,19 +39,17 @@ def fake_exception(status_code=404, message=None, details=None):
class FakeClient(fakes.FakeClient, Client): class FakeClient(fakes.FakeClient, Client):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(FakeClient, self).__init__('username', 'password', 'project_id', super(FakeClient, self).__init__(direct_use=False)
'auth_url', direct_use=False) self.client = FakeSessionClient(session=mock.Mock(), **kwargs)
self.client = FakeHTTPClient(**kwargs)
class FakeHTTPClient(base_client.HTTPClient): class FakeSessionClient(base_client.SessionClient):
def __init__(self, **kwargs): def __init__(self, *args, **kwargs):
super(FakeHTTPClient, self).__init__('username', 'password', super(FakeSessionClient, self).__init__(*args, **kwargs)
'project_id', 'auth_url')
self.callstack = [] self.callstack = []
def _cs_request(self, url, method, **kwargs): def request(self, url, method, **kwargs):
# Check that certain things are called correctly # Check that certain things are called correctly
if method in ['GET', 'DELETE']: if method in ['GET', 'DELETE']:
assert 'body' not in kwargs assert 'body' not in kwargs