class RemoteRestError(exceptions.NeutronException):
-
- def __init__(self, message):
- if message is None:
- message = "None"
- self.message = _("Error in REST call to remote network "
- "controller") + ": " + message
- super(RemoteRestError, self).__init__()
+ message = _("Error in REST call to remote network "
+ "controller: %(reason)s")
class ServerProxy(object):
resp = self.rest_call(action, resource, data, headers, ignore_codes)
if self.server_failure(resp, ignore_codes):
LOG.error(_("NeutronRestProxyV2: ") + errstr, resp[2])
- raise RemoteRestError(resp[2])
+ raise RemoteRestError(reason=resp[2])
if resp[0] in ignore_codes:
LOG.warning(_("NeutronRestProxyV2: Received and ignored error "
"code %(code)s on %(action)s action to resource "
plugin_obj = NeutronManager.get_plugin()
with patch.object(plugin_obj.servers,
'rest_plug_interface') as mock_plug_interface:
- mock_plug_interface.side_effect = RemoteRestError('fake error')
+ mock_plug_interface.side_effect = RemoteRestError(
+ reason='fake error')
kwargs = {'device_id': 'somedevid',
'tenant_id': n['network']['tenant_id']}
self._create_port('json', n['network']['id'],
'rest_delete_port'
) as mock_plug_interface:
mock_plug_interface.side_effect = RemoteRestError(
- 'fake error')
+ reason='fake error')
self._delete('ports', port['port']['id'],
expected_code=
webob.exc.HTTPInternalServerError.code)