Merge "Use status_code instead of status in requests"
This commit is contained in:
commit
a7a4cf0453
|
@ -231,7 +231,8 @@ class MetadataProxyHandler(object):
|
|||
explanation = six.text_type(msg)
|
||||
return webob.exc.HTTPInternalServerError(explanation=explanation)
|
||||
else:
|
||||
raise Exception(_('Unexpected response code: %s') % resp.status)
|
||||
raise Exception(_('Unexpected response code: %s') %
|
||||
resp.status_code)
|
||||
|
||||
def _sign_instance_id(self, instance_id):
|
||||
secret = self.conf.metadata_proxy_shared_secret
|
||||
|
|
|
@ -340,6 +340,7 @@ class _TestMetadataProxyHandlerCacheMixin(object):
|
|||
req = mock.Mock(path_info='/the_path', query_string='', headers=hdrs,
|
||||
method=method, body=body)
|
||||
resp = mock.MagicMock(status_code=response_code)
|
||||
resp.status.__str__.side_effect = AttributeError
|
||||
resp.content = 'content'
|
||||
req.response = resp
|
||||
with mock.patch.object(self.handler, '_sign_instance_id') as sign:
|
||||
|
|
Loading…
Reference in New Issue