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

« back to all changes in this revision

Viewing changes to neutron/agent/linux/ip_link_support.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:
15
15
 
16
16
import re
17
17
 
 
18
from oslo_log import log as logging
 
19
 
18
20
from neutron.agent.linux import utils
19
21
from neutron.common import exceptions as n_exc
20
22
from neutron.i18n import _LE
21
 
from neutron.openstack.common import log as logging
22
23
 
23
24
 
24
25
LOG = logging.getLogger(__name__)
51
52
    SUB_CAPABILITY_REGEX = r"\[ %(cap)s (.*) \[ %(subcap)s (.*)"
52
53
 
53
54
    @classmethod
54
 
    def get_vf_mgmt_section(cls, root_helper=None):
55
 
        """Parses ip link help output, and gets vf block
56
 
 
57
 
        :param root_helper: root permission helper
58
 
 
59
 
        """
60
 
        output = cls._get_ip_link_output(root_helper)
 
55
    def get_vf_mgmt_section(cls):
 
56
        """Parses ip link help output, and gets vf block"""
 
57
 
 
58
        output = cls._get_ip_link_output()
61
59
        vf_block_pattern = re.search(cls.VF_BLOCK_REGEX,
62
60
                                     output,
63
61
                                     re.DOTALL | re.MULTILINE)
87
85
        return pattern_match is not None
88
86
 
89
87
    @classmethod
90
 
    def _get_ip_link_output(cls, root_helper):
 
88
    def _get_ip_link_output(cls):
91
89
        """Gets the output of the ip link help command
92
90
 
93
91
        Runs ip link help command and stores its output
99
97
        try:
100
98
            ip_cmd = ['ip', 'link', 'help']
101
99
            _stdout, _stderr = utils.execute(
102
 
                ip_cmd, root_helper,
 
100
                ip_cmd,
103
101
                check_exit_code=False,
104
102
                return_stderr=True,
105
103
                log_fail_as_error=False)