This patch drops several uses of the RpcCallback compatibility class.
All of these were trivial and straight forward conversions so I
batched them up.
There are still several other uses of RpcCallback, but the conversions
are were not necessarily trivial, and may be broken in one way or
another, so I wanted to address them separately. In particular, the
use of mixin classes means that there could be cases where the version
declaration is being stepped on, so they need to be investigated more
closely.
Part of blueprint drop-rpc-compat.
Change-Id: I0977aee863d4fcc6a14a025215c6e41fe38a87f0
# License for the specific language governing permissions and limitations
# under the License.
+from oslo import messaging
+
from neutron.common import log
-from neutron.common import rpc as n_rpc
from neutron.common import topics
from neutron import manager
from neutron.openstack.common import log as logging
version=self.DVR_RPC_VERSION)
-class DVRServerRpcCallback(n_rpc.RpcCallback):
+class DVRServerRpcCallback(object):
"""Plugin-side RPC (implementation) for agent-to-plugin interaction."""
# History
# 1.0 Initial version
- RPC_API_VERSION = "1.0"
+ target = messaging.Target(version='1.0')
@property
def plugin(self):
# limitations under the License.
from oslo.config import cfg
+from oslo import messaging
from oslo.serialization import jsonutils
from neutron.common import constants
from neutron.common import exceptions
-from neutron.common import rpc as n_rpc
from neutron.common import utils
from neutron import context as neutron_context
from neutron.extensions import l3
LOG = logging.getLogger(__name__)
-class L3RpcCallback(n_rpc.RpcCallback):
+class L3RpcCallback(object):
"""L3 agent RPC callback in plugin implementations."""
# 1.0 L3PluginApi BASE_RPC_API_VERSION
# 1.2 Added methods for DVR support
# 1.3 Added a method that returns the list of activated services
# 1.4 Added L3 HA update_router_state
- RPC_API_VERSION = '1.4'
+ target = messaging.Target(version='1.4')
@property
def plugin(self):
# See the License for the specific language governing permissions and
# limitations under the License.
-from neutron.common import rpc as n_rpc
+from oslo import messaging
+
from neutron import manager
-class MetadataRpcCallback(n_rpc.RpcCallback):
+class MetadataRpcCallback(object):
"""Metadata agent RPC callback in plugin implementations."""
# 1.0 MetadataPluginAPI BASE_RPC_API_VERSION
- RPC_API_VERSION = '1.0'
+ target = messaging.Target(version='1.0')
@property
def plugin(self):
# License for the specific language governing permissions and limitations
# under the License.
-from neutron.common import rpc as n_rpc
+from oslo import messaging
+
from neutron import manager
# from neutron/agent/securitygroups_rpc.py.
-class SecurityGroupServerRpcCallback(n_rpc.RpcCallback):
+class SecurityGroupServerRpcCallback(object):
"""Callback for SecurityGroup agent RPC in plugin implementations."""
# API version history:
# 1.1 - Initial version
# 1.2 - security_group_info_for_devices introduced as an optimization
- # NOTE: RPC_API_VERSION must not be overridden in subclasses
+ # NOTE: target must not be overridden in subclasses
# to keep RPC API version consistent across plugins.
- RPC_API_VERSION = '1.2'
+ target = messaging.Target(version='1.2')
@property
def plugin(self):
from oslo.config import cfg
from oslo.db import exception as db_exc
+from oslo import messaging
from oslo.serialization import jsonutils
import sqlalchemy as sa
from sqlalchemy.orm import exc
from sqlalchemy import sql
-from neutron.common import rpc as n_rpc
from neutron.db import model_base
from neutron.db import models_v2
from neutron.extensions import agent as ext_agent
return self._create_or_update_agent(context, agent)
-class AgentExtRpcCallback(n_rpc.RpcCallback):
+class AgentExtRpcCallback(object):
"""Processes the rpc report in plugin implementations."""
- RPC_API_VERSION = '1.0'
+ target = messaging.Target(version='1.0')
START_TIME = timeutils.utcnow()
def __init__(self, plugin=None):
"""Implentation of Brocade Neutron Plugin."""
from oslo.config import cfg
+from oslo import messaging
from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
cfg.CONF.register_opts(PHYSICAL_INTERFACE_OPTS, "PHYSICAL_INTERFACE")
-class BridgeRpcCallbacks(n_rpc.RpcCallback):
+class BridgeRpcCallbacks(object):
"""Agent callback."""
- RPC_API_VERSION = '1.2'
+ target = messaging.Target(version='1.2')
# Device names start with "tap"
# history
# 1.1 Support Security Group RPC
eventlet.monkey_patch()
from oslo.config import cfg
+from oslo import messaging
from neutron.agent.common import config
from neutron.agent import rpc as agent_rpc
pass
-class HyperVNeutronAgent(n_rpc.RpcCallback):
+class HyperVNeutronAgent(object):
# Set RPC API version to 1.1 by default.
- RPC_API_VERSION = '1.1'
+ target = messaging.Target(version='1.1')
def __init__(self):
super(HyperVNeutronAgent, self).__init__()
# License for the specific language governing permissions and limitations
# under the License.
+from oslo import messaging
+
from neutron.common import constants as q_const
-from neutron.common import rpc as n_rpc
from neutron.openstack.common import log as logging
from neutron.plugins.hyperv import db as hyperv_db
LOG = logging.getLogger(__name__)
-class HyperVRpcCallbacks(n_rpc.RpcCallback):
+class HyperVRpcCallbacks(object):
# history
# 1.1 Support Security Group RPC
# 1.2 Support get_devices_details_list
- RPC_API_VERSION = '1.2'
+ target = messaging.Target(version='1.2')
def __init__(self, notifier):
super(HyperVRpcCallbacks, self).__init__()
eventlet.monkey_patch()
from oslo.config import cfg
+from oslo import messaging
from neutron.agent.linux import ip_lib
from neutron.agent.linux import ovs_lib
from neutron.agent import rpc as agent_rpc
from neutron.common import config as common_config
from neutron.common import constants as n_const
-from neutron.common import rpc as n_rpc
from neutron.common import topics
from neutron.common import utils as n_utils
from neutron import context
self.make_msg('sdnve_info', info=info))
-class SdnveNeutronAgent(n_rpc.RpcCallback):
+class SdnveNeutronAgent(object):
- RPC_API_VERSION = '1.1'
+ target = messaging.Target(version='1.1')
def __init__(self, integ_br, interface_mappings,
info, root_helper, polling_interval,
# under the License.
from oslo.config import cfg
+from oslo import messaging
from neutron.common import exceptions as n_exception
from neutron.common import rpc as n_rpc
LOG = logging.getLogger(__name__)
-class FirewallCallbacks(n_rpc.RpcCallback):
- RPC_API_VERSION = '1.0'
+class FirewallCallbacks(object):
+ target = messaging.Target(version='1.0')
def __init__(self, plugin):
super(FirewallCallbacks, self).__init__()
# under the License.
import netaddr
+from oslo import messaging
+
from neutron.common import rpc as n_rpc
from neutron.openstack.common import log as logging
from neutron.services.vpn.common import topics
BASE_IPSEC_VERSION = '1.0'
-class IPsecVpnDriverCallBack(n_rpc.RpcCallback):
+class IPsecVpnDriverCallBack(object):
"""Callback for IPSecVpnDriver rpc."""
# history
# 1.0 Initial version
- RPC_API_VERSION = BASE_IPSEC_VERSION
+ target = messaging.Target(version=BASE_IPSEC_VERSION)
def __init__(self, driver):
super(IPsecVpnDriverCallBack, self).__init__()