~ubuntu-branches/ubuntu/vivid/neutron/vivid-updates

« back to all changes in this revision

Viewing changes to neutron/plugins/oneconvergence/agent/nvsd_neutron_agent.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-03-30 11:17:19 UTC
  • mfrom: (1.1.21)
  • Revision ID: package-import@ubuntu.com-20150330111719-h0gx7233p4jkkgfh
Tags: 1:2015.1~b3-0ubuntu1
* New upstream milestone release:
  - d/control: Align version requirements with upstream.
  - d/control: Add new dependency on oslo-log.
  - d/p/*: Rebase.
  - d/control,d/neutron-plugin-hyperv*: Dropped, decomposed into
    separate project upstream.
  - d/control,d/neutron-plugin-openflow*: Dropped, decomposed into
    separate project upstream.
  - d/neutron-common.install: Add neutron-rootwrap-daemon and 
    neutron-keepalived-state-change binaries.
  - d/rules: Ignore neutron-hyperv-agent when installing; only for Windows.
  - d/neutron-plugin-cisco.install: Drop neutron-cisco-cfg-agent as
    decomposed into separate project upstream.
  - d/neutron-plugin-vmware.install: Drop neutron-check-nsx-config and
    neutron-nsx-manage as decomposed into separate project upstream.
  - d/control: Add dependency on python-neutron-fwaas to neutron-l3-agent.
* d/pydist-overrides: Add overrides for oslo packages.
* d/control: Fixup type in package description (LP: #1263539).
* d/p/fixup-driver-test-execution.patch: Cherry pick fix from upstream VCS
  to support unit test exection in out-of-tree vendor drivers.
* d/neutron-common.postinst: Allow general access to /etc/neutron but limit
  access to root/neutron to /etc/neutron/neutron.conf to support execution
  of unit tests in decomposed vendor drivers.
* d/control: Add dependency on python-neutron-fwaas to neutron-l3-agent
  package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import eventlet
22
22
eventlet.monkey_patch()
23
23
 
24
 
from oslo import messaging
 
24
from oslo_log import log as logging
 
25
import oslo_messaging
25
26
 
26
27
from neutron.agent.linux import ovs_lib
27
28
from neutron.agent import rpc as agent_rpc
31
32
from neutron import context as n_context
32
33
from neutron.extensions import securitygroup as ext_sg
33
34
from neutron.i18n import _LE, _LI
34
 
from neutron.openstack.common import log as logging
35
35
from neutron.plugins.oneconvergence.lib import config
36
36
 
37
37
LOG = logging.getLogger(__name__)
39
39
 
40
40
class NVSDAgentRpcCallback(object):
41
41
 
42
 
    target = messaging.Target(version='1.0')
 
42
    target = oslo_messaging.Target(version='1.0')
43
43
 
44
44
    def __init__(self, context, agent, sg_agent):
45
45
        super(NVSDAgentRpcCallback, self).__init__()
61
61
 
62
62
class SecurityGroupAgentRpcCallback(sg_rpc.SecurityGroupAgentRpcCallbackMixin):
63
63
 
64
 
    target = messaging.Target(version=sg_rpc.SG_RPC_VERSION)
 
64
    target = oslo_messaging.Target(version=sg_rpc.SG_RPC_VERSION)
65
65
 
66
66
    def __init__(self, context, sg_agent):
67
67
        super(SecurityGroupAgentRpcCallback, self).__init__()
73
73
    # history
74
74
    #   1.0 Initial version
75
75
    #   1.1 Support Security Group RPC
76
 
    target = messaging.Target(version='1.1')
 
76
    target = oslo_messaging.Target(version='1.1')
77
77
 
78
 
    def __init__(self, integ_br, root_helper, polling_interval):
 
78
    def __init__(self, integ_br, polling_interval):
79
79
        super(NVSDNeutronAgent, self).__init__()
80
 
        self.int_br = ovs_lib.OVSBridge(integ_br, root_helper)
 
80
        self.int_br = ovs_lib.OVSBridge(integ_br)
81
81
        self.polling_interval = polling_interval
82
 
        self.root_helper = root_helper
83
82
        self.setup_rpc()
84
83
        self.ports = set()
85
84
 
93
92
        self.context = n_context.get_admin_context_without_session()
94
93
        self.sg_plugin_rpc = sg_rpc.SecurityGroupServerRpcApi(topics.PLUGIN)
95
94
        self.sg_agent = sg_rpc.SecurityGroupAgentRpc(self.context,
96
 
                                                     self.sg_plugin_rpc,
97
 
                                                     self.root_helper)
 
95
                                                     self.sg_plugin_rpc)
98
96
 
99
97
        # RPC network init
100
98
        # Handle updates from service
150
148
    common_config.setup_logging()
151
149
 
152
150
    integ_br = config.AGENT.integration_bridge
153
 
    root_helper = config.AGENT.root_helper
154
151
    polling_interval = config.AGENT.polling_interval
155
 
    agent = NVSDNeutronAgent(integ_br, root_helper, polling_interval)
 
152
    agent = NVSDNeutronAgent(integ_br, polling_interval)
156
153
    LOG.info(_LI("NVSD Agent initialized successfully, now running... "))
157
154
 
158
155
    # Start everything.