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

« back to all changes in this revision

Viewing changes to neutron/services/firewall/agents/l3reference/firewall_l3_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:
13
13
#    License for the specific language governing permissions and limitations
14
14
#    under the License.
15
15
 
16
 
from oslo.config import cfg
17
 
from oslo.utils import importutils
 
16
from oslo_config import cfg
 
17
from oslo_log import log as logging
 
18
from oslo_utils import importutils
18
19
 
19
 
from neutron.agent.common import config
20
20
from neutron.agent.linux import ip_lib
21
21
from neutron.common import exceptions as nexception
22
22
from neutron.common import topics
23
23
from neutron import context
24
24
from neutron.i18n import _LE
25
 
from neutron.openstack.common import log as logging
26
25
from neutron.plugins.common import constants
27
26
from neutron.services.firewall.agents import firewall_agent_api as api
28
27
from neutron.services import provider_configuration as provconf
81
80
                msg = _('Error importing FWaaS device driver: %s')
82
81
                raise ImportError(msg % fwaas_driver_class_path)
83
82
        self.services_sync = False
84
 
        self.root_helper = config.get_root_helper(conf)
85
83
        # setup RPC to msg fwaas plugin
86
84
        self.fwplugin_rpc = FWaaSL3PluginApi(topics.FIREWALL_PLUGIN,
87
85
                                             conf.host)
89
87
 
90
88
    def _get_router_info_list_for_tenant(self, routers, tenant_id):
91
89
        """Returns the list of router info objects on which to apply the fw."""
92
 
        root_ip = ip_lib.IPWrapper(self.root_helper)
 
90
        root_ip = ip_lib.IPWrapper()
93
91
        # Get the routers for the tenant
94
92
        router_ids = [
95
93
            router['id']
96
94
            for router in routers
97
95
            if router['tenant_id'] == tenant_id]
98
 
        local_ns_list = root_ip.get_namespaces(
99
 
            self.root_helper) if self.conf.use_namespaces else []
 
96
        local_ns_list = (root_ip.get_namespaces()
 
97
                         if self.conf.use_namespaces else [])
100
98
 
101
99
        router_info_list = []
102
100
        # Pick up namespaces for Tenant Routers