Merge "Remove neutron.common.rpc.RPCException"

This commit is contained in:
Jenkins 2014-11-13 23:39:03 +00:00 committed by Gerrit Code Review
commit bf7b66fd6e
5 changed files with 8 additions and 6 deletions

View File

@ -1896,7 +1896,7 @@ class L3NATAgent(firewall_l3_agent.FWaaSL3AgentRpcCallback,
self._queue.add(update) self._queue.add(update)
self.fullsync = False self.fullsync = False
LOG.debug(_("_sync_routers_task successfully completed")) LOG.debug(_("_sync_routers_task successfully completed"))
except n_rpc.RPCException: except messaging.MessagingException:
LOG.exception(_("Failed synchronizing routers due to RPC error")) LOG.exception(_("Failed synchronizing routers due to RPC error"))
self.fullsync = True self.fullsync = True
except Exception: except Exception:

View File

@ -24,6 +24,7 @@ eventlet.monkey_patch()
import httplib2 import httplib2
from neutronclient.v2_0 import client from neutronclient.v2_0 import client
from oslo.config import cfg from oslo.config import cfg
from oslo import messaging
import six.moves.urllib.parse as urlparse import six.moves.urllib.parse as urlparse
import webob import webob
@ -167,7 +168,7 @@ class MetadataProxyHandler(object):
if self.use_rpc: if self.use_rpc:
try: try:
return self.plugin_rpc.get_ports(self.context, filters) return self.plugin_rpc.get_ports(self.context, filters)
except (n_rpc.RPCException, AttributeError): except (messaging.MessagingException, AttributeError):
# TODO(obondarev): remove fallback once RPC is proven # TODO(obondarev): remove fallback once RPC is proven
# to work fine with metadata agent (K or L release at most) # to work fine with metadata agent (K or L release at most)
LOG.warning(_LW('Server does not support metadata RPC, ' LOG.warning(_LW('Server does not support metadata RPC, '

View File

@ -275,6 +275,5 @@ def create_connection(new=True):
# exceptions # exceptions
RPCException = messaging.MessagingException
RemoteError = messaging.RemoteError RemoteError = messaging.RemoteError
MessagingTimeout = messaging.MessagingTimeout MessagingTimeout = messaging.MessagingTimeout

View File

@ -16,6 +16,8 @@ import collections
import eventlet import eventlet
import netaddr import netaddr
from oslo import messaging
from neutron.common import constants as l3_constants from neutron.common import constants as l3_constants
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc
from neutron.common import topics from neutron.common import topics
@ -284,7 +286,7 @@ class RoutingServiceHelper():
if device_ids: if device_ids:
return self.plugin_rpc.get_routers(self.context, return self.plugin_rpc.get_routers(self.context,
hd_ids=device_ids) hd_ids=device_ids)
except n_rpc.RPCException: except messaging.MessagingException:
LOG.exception(_("RPC Error in fetching routers from plugin")) LOG.exception(_("RPC Error in fetching routers from plugin"))
self.fullsync = True self.fullsync = True

View File

@ -15,10 +15,10 @@
import copy import copy
import mock import mock
from oslo.config import cfg from oslo.config import cfg
from oslo import messaging
from neutron.common import config as base_config from neutron.common import config as base_config
from neutron.common import constants as l3_constants from neutron.common import constants as l3_constants
from neutron.common import rpc as n_rpc
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
from neutron.openstack.common import uuidutils from neutron.openstack.common import uuidutils
from neutron.plugins.cisco.cfg_agent import cfg_agent from neutron.plugins.cisco.cfg_agent import cfg_agent
@ -583,7 +583,7 @@ class TestBasicRoutingOperations(base.BaseTestCase):
@mock.patch("eventlet.GreenPool.spawn_n") @mock.patch("eventlet.GreenPool.spawn_n")
def test_process_services_with_rpc_error(self, mock_spawn): def test_process_services_with_rpc_error(self, mock_spawn):
router, port = prepare_router_data() router, port = prepare_router_data()
self.plugin_api.get_routers.side_effect = n_rpc.RPCException self.plugin_api.get_routers.side_effect = messaging.MessagingException
self.routing_helper.fullsync = False self.routing_helper.fullsync = False
self.routing_helper.updated_routers.add(router['id']) self.routing_helper.updated_routers.add(router['id'])
self.routing_helper.process_service() self.routing_helper.process_service()