Merge "Drop several uses of RpcCallback"

This commit is contained in:
Jenkins 2014-11-20 08:53:25 +00:00 committed by Gerrit Code Review
commit 0c6a199c13
11 changed files with 39 additions and 30 deletions

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo import messaging
from neutron.common import log from neutron.common import log
from neutron.common import rpc as n_rpc
from neutron.common import topics from neutron.common import topics
from neutron import manager from neutron import manager
from neutron.openstack.common import log as logging from neutron.openstack.common import log as logging
@ -57,13 +58,13 @@ class DVRServerRpcApiMixin(object):
version=self.DVR_RPC_VERSION) version=self.DVR_RPC_VERSION)
class DVRServerRpcCallback(n_rpc.RpcCallback): class DVRServerRpcCallback(object):
"""Plugin-side RPC (implementation) for agent-to-plugin interaction.""" """Plugin-side RPC (implementation) for agent-to-plugin interaction."""
# History # History
# 1.0 Initial version # 1.0 Initial version
RPC_API_VERSION = "1.0" target = messaging.Target(version='1.0')
@property @property
def plugin(self): def plugin(self):

View File

@ -14,11 +14,11 @@
# limitations under the License. # limitations under the License.
from oslo.config import cfg from oslo.config import cfg
from oslo import messaging
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
from neutron.common import constants from neutron.common import constants
from neutron.common import exceptions from neutron.common import exceptions
from neutron.common import rpc as n_rpc
from neutron.common import utils from neutron.common import utils
from neutron import context as neutron_context from neutron import context as neutron_context
from neutron.extensions import l3 from neutron.extensions import l3
@ -32,7 +32,7 @@ from neutron.plugins.common import constants as plugin_constants
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class L3RpcCallback(n_rpc.RpcCallback): class L3RpcCallback(object):
"""L3 agent RPC callback in plugin implementations.""" """L3 agent RPC callback in plugin implementations."""
# 1.0 L3PluginApi BASE_RPC_API_VERSION # 1.0 L3PluginApi BASE_RPC_API_VERSION
@ -40,7 +40,7 @@ class L3RpcCallback(n_rpc.RpcCallback):
# 1.2 Added methods for DVR support # 1.2 Added methods for DVR support
# 1.3 Added a method that returns the list of activated services # 1.3 Added a method that returns the list of activated services
# 1.4 Added L3 HA update_router_state # 1.4 Added L3 HA update_router_state
RPC_API_VERSION = '1.4' target = messaging.Target(version='1.4')
@property @property
def plugin(self): def plugin(self):

View File

@ -13,15 +13,16 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from neutron.common import rpc as n_rpc from oslo import messaging
from neutron import manager from neutron import manager
class MetadataRpcCallback(n_rpc.RpcCallback): class MetadataRpcCallback(object):
"""Metadata agent RPC callback in plugin implementations.""" """Metadata agent RPC callback in plugin implementations."""
# 1.0 MetadataPluginAPI BASE_RPC_API_VERSION # 1.0 MetadataPluginAPI BASE_RPC_API_VERSION
RPC_API_VERSION = '1.0' target = messaging.Target(version='1.0')
@property @property
def plugin(self): def plugin(self):

View File

@ -12,7 +12,8 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from neutron.common import rpc as n_rpc from oslo import messaging
from neutron import manager from neutron import manager
@ -20,16 +21,16 @@ from neutron import manager
# from neutron/agent/securitygroups_rpc.py. # from neutron/agent/securitygroups_rpc.py.
class SecurityGroupServerRpcCallback(n_rpc.RpcCallback): class SecurityGroupServerRpcCallback(object):
"""Callback for SecurityGroup agent RPC in plugin implementations.""" """Callback for SecurityGroup agent RPC in plugin implementations."""
# API version history: # API version history:
# 1.1 - Initial version # 1.1 - Initial version
# 1.2 - security_group_info_for_devices introduced as an optimization # 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. # to keep RPC API version consistent across plugins.
RPC_API_VERSION = '1.2' target = messaging.Target(version='1.2')
@property @property
def plugin(self): def plugin(self):

View File

@ -17,12 +17,12 @@ from eventlet import greenthread
from oslo.config import cfg from oslo.config import cfg
from oslo.db import exception as db_exc from oslo.db import exception as db_exc
from oslo import messaging
from oslo.serialization import jsonutils from oslo.serialization import jsonutils
import sqlalchemy as sa import sqlalchemy as sa
from sqlalchemy.orm import exc from sqlalchemy.orm import exc
from sqlalchemy import sql from sqlalchemy import sql
from neutron.common import rpc as n_rpc
from neutron.db import model_base from neutron.db import model_base
from neutron.db import models_v2 from neutron.db import models_v2
from neutron.extensions import agent as ext_agent from neutron.extensions import agent as ext_agent
@ -215,10 +215,10 @@ class AgentDbMixin(ext_agent.AgentPluginBase):
return self._create_or_update_agent(context, agent) return self._create_or_update_agent(context, agent)
class AgentExtRpcCallback(n_rpc.RpcCallback): class AgentExtRpcCallback(object):
"""Processes the rpc report in plugin implementations.""" """Processes the rpc report in plugin implementations."""
RPC_API_VERSION = '1.0' target = messaging.Target(version='1.0')
START_TIME = timeutils.utcnow() START_TIME = timeutils.utcnow()
def __init__(self, plugin=None): def __init__(self, plugin=None):

View File

@ -20,6 +20,7 @@
"""Implentation of Brocade Neutron Plugin.""" """Implentation of Brocade Neutron Plugin."""
from oslo.config import cfg from oslo.config import cfg
from oslo import messaging
from neutron.agent import securitygroups_rpc as sg_rpc from neutron.agent import securitygroups_rpc as sg_rpc
from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api from neutron.api.rpc.agentnotifiers import dhcp_rpc_agent_api
@ -75,10 +76,10 @@ cfg.CONF.register_opts(SWITCH_OPTS, "SWITCH")
cfg.CONF.register_opts(PHYSICAL_INTERFACE_OPTS, "PHYSICAL_INTERFACE") cfg.CONF.register_opts(PHYSICAL_INTERFACE_OPTS, "PHYSICAL_INTERFACE")
class BridgeRpcCallbacks(n_rpc.RpcCallback): class BridgeRpcCallbacks(object):
"""Agent callback.""" """Agent callback."""
RPC_API_VERSION = '1.2' target = messaging.Target(version='1.2')
# Device names start with "tap" # Device names start with "tap"
# history # history
# 1.1 Support Security Group RPC # 1.1 Support Security Group RPC

View File

@ -23,6 +23,7 @@ import eventlet
eventlet.monkey_patch() eventlet.monkey_patch()
from oslo.config import cfg from oslo.config import cfg
from oslo import messaging
from neutron.agent.common import config from neutron.agent.common import config
from neutron.agent import rpc as agent_rpc from neutron.agent import rpc as agent_rpc
@ -116,9 +117,9 @@ class HyperVPluginApi(agent_rpc.PluginApi,
pass pass
class HyperVNeutronAgent(n_rpc.RpcCallback): class HyperVNeutronAgent(object):
# Set RPC API version to 1.1 by default. # Set RPC API version to 1.1 by default.
RPC_API_VERSION = '1.1' target = messaging.Target(version='1.1')
def __init__(self): def __init__(self):
super(HyperVNeutronAgent, self).__init__() super(HyperVNeutronAgent, self).__init__()

View File

@ -13,8 +13,9 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo import messaging
from neutron.common import constants as q_const 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.openstack.common import log as logging
from neutron.plugins.hyperv import db as hyperv_db from neutron.plugins.hyperv import db as hyperv_db
@ -22,12 +23,12 @@ from neutron.plugins.hyperv import db as hyperv_db
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class HyperVRpcCallbacks(n_rpc.RpcCallback): class HyperVRpcCallbacks(object):
# history # history
# 1.1 Support Security Group RPC # 1.1 Support Security Group RPC
# 1.2 Support get_devices_details_list # 1.2 Support get_devices_details_list
RPC_API_VERSION = '1.2' target = messaging.Target(version='1.2')
def __init__(self, notifier): def __init__(self, notifier):
super(HyperVRpcCallbacks, self).__init__() super(HyperVRpcCallbacks, self).__init__()

View File

@ -23,13 +23,13 @@ import eventlet
eventlet.monkey_patch() eventlet.monkey_patch()
from oslo.config import cfg from oslo.config import cfg
from oslo import messaging
from neutron.agent.linux import ip_lib from neutron.agent.linux import ip_lib
from neutron.agent.linux import ovs_lib from neutron.agent.linux import ovs_lib
from neutron.agent import rpc as agent_rpc from neutron.agent import rpc as agent_rpc
from neutron.common import config as common_config from neutron.common import config as common_config
from neutron.common import constants as n_const 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 topics
from neutron.common import utils as n_utils from neutron.common import utils as n_utils
from neutron import context from neutron import context
@ -50,9 +50,9 @@ class SdnvePluginApi(agent_rpc.PluginApi):
self.make_msg('sdnve_info', info=info)) 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, def __init__(self, integ_br, interface_mappings,
info, root_helper, polling_interval, info, root_helper, polling_interval,

View File

@ -14,6 +14,7 @@
# under the License. # under the License.
from oslo.config import cfg from oslo.config import cfg
from oslo import messaging
from neutron.common import exceptions as n_exception from neutron.common import exceptions as n_exception
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc
@ -28,8 +29,8 @@ from neutron.plugins.common import constants as const
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class FirewallCallbacks(n_rpc.RpcCallback): class FirewallCallbacks(object):
RPC_API_VERSION = '1.0' target = messaging.Target(version='1.0')
def __init__(self, plugin): def __init__(self, plugin):
super(FirewallCallbacks, self).__init__() super(FirewallCallbacks, self).__init__()

View File

@ -14,6 +14,8 @@
# under the License. # under the License.
import netaddr import netaddr
from oslo import messaging
from neutron.common import rpc as n_rpc 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.services.vpn.common import topics from neutron.services.vpn.common import topics
@ -26,13 +28,13 @@ IPSEC = 'ipsec'
BASE_IPSEC_VERSION = '1.0' BASE_IPSEC_VERSION = '1.0'
class IPsecVpnDriverCallBack(n_rpc.RpcCallback): class IPsecVpnDriverCallBack(object):
"""Callback for IPSecVpnDriver rpc.""" """Callback for IPSecVpnDriver rpc."""
# history # history
# 1.0 Initial version # 1.0 Initial version
RPC_API_VERSION = BASE_IPSEC_VERSION target = messaging.Target(version=BASE_IPSEC_VERSION)
def __init__(self, driver): def __init__(self, driver):
super(IPsecVpnDriverCallBack, self).__init__() super(IPsecVpnDriverCallBack, self).__init__()