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

« back to all changes in this revision

Viewing changes to neutron/plugins/nec/agent/nec_neutron_agent.py

  • Committer: Package Import Robot
  • Author(s): Corey Bryant, Corey Bryant, James Page
  • Date: 2015-02-16 09:59:01 UTC
  • mfrom: (1.1.20)
  • Revision ID: package-import@ubuntu.com-20150216095901-irf6gdwh5tzmfi73
Tags: 1:2015.1~b2-0ubuntu1
[ Corey Bryant ]
* New upstream release.
  - d/control: Align with upstream dependencies.
  - d/p/disable-udev-tests.patch: Rebased.
  - d/p/pep-0476.patch: Dropped. Fixed upstream.

[ James Page ]
* d/neutron-common.install: Drop fwaas_driver.ini and vpnaas.filters, will
  provided by driver specific packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
from neutron.agent import securitygroups_rpc as sg_rpc
33
33
from neutron.common import config as common_config
34
34
from neutron.common import constants as q_const
35
 
from neutron.common import rpc as n_rpc
36
35
from neutron.common import topics
37
36
from neutron import context as q_context
38
37
from neutron.extensions import securitygroup as ext_sg
83
82
            self.sg_agent.refresh_firewall()
84
83
 
85
84
 
86
 
class SecurityGroupServerRpcApi(sg_rpc.SecurityGroupServerRpcApiMixin):
87
 
 
88
 
    def __init__(self, topic):
89
 
        self.topic = topic
90
 
        target = messaging.Target(topic=topic, version=sg_rpc.SG_RPC_VERSION)
91
 
        self.client = n_rpc.get_client(target)
92
 
 
93
 
 
94
85
class SecurityGroupAgentRpcCallback(sg_rpc.SecurityGroupAgentRpcCallbackMixin):
95
86
 
96
87
    target = messaging.Target(version=sg_rpc.SG_RPC_VERSION)
101
92
        self.sg_agent = sg_agent
102
93
 
103
94
 
104
 
class SecurityGroupAgentRpc(sg_rpc.SecurityGroupAgentRpcMixin):
105
 
 
106
 
    def __init__(self, context):
107
 
        self.context = context
108
 
        self.plugin_rpc = SecurityGroupServerRpcApi(topics.PLUGIN)
109
 
        self.init_firewall()
110
 
 
111
 
 
112
95
class NECNeutronAgent(object):
113
96
 
114
97
    def __init__(self, integ_br, root_helper, polling_interval):
133
116
            'agent_type': q_const.AGENT_TYPE_NEC,
134
117
            'start_flag': True}
135
118
 
136
 
        self.setup_rpc()
 
119
        self.setup_rpc(root_helper)
137
120
 
138
 
    def setup_rpc(self):
 
121
    def setup_rpc(self, root_helper):
139
122
        self.host = socket.gethostname()
140
123
        self.agent_id = 'nec-q-agent.%s' % self.host
141
124
        LOG.info(_LI("RPC agent_id: %s"), self.agent_id)
145
128
 
146
129
        self.plugin_rpc = NECPluginApi(topics.PLUGIN)
147
130
        self.state_rpc = agent_rpc.PluginReportStateAPI(topics.PLUGIN)
148
 
        self.sg_agent = SecurityGroupAgentRpc(self.context)
 
131
        self.sg_plugin_rpc = sg_rpc.SecurityGroupServerRpcApi(topics.PLUGIN)
 
132
        self.sg_agent = sg_rpc.SecurityGroupAgentRpc(self.context,
 
133
                self.sg_plugin_rpc, root_helper)
149
134
 
150
135
        # RPC network init
151
136
        # Handle updates from service