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

« back to all changes in this revision

Viewing changes to neutron/agent/common/config.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 os
17
17
 
18
 
from oslo.config import cfg
 
18
from oslo_config import cfg
 
19
from oslo_log import log as logging
19
20
 
20
21
from neutron.common import config
21
 
from neutron.openstack.common import log as logging
22
22
 
23
23
 
24
24
LOG = logging.getLogger(__name__)
31
31
                default=True,
32
32
                help=_('Use the root helper to read the namespaces from '
33
33
                       'the operating system.')),
 
34
    # We can't just use root_helper=sudo neutron-rootwrap-daemon $cfg because
 
35
    # it isn't appropriate for long-lived processes spawned with create_process
 
36
    # Having a bool use_rootwrap_daemon option precludes specifying the
 
37
    # rootwrap daemon command, which may be necessary for Xen?
 
38
    cfg.StrOpt('root_helper_daemon',
 
39
               help=_('Root helper daemon application to use when possible.')),
34
40
]
35
41
 
36
42
AGENT_STATE_OPTS = [
93
99
 
94
100
 
95
101
def register_root_helper(conf):
96
 
    # The first call is to ensure backward compatibility
97
 
    conf.register_opts(ROOT_HELPER_OPTS)
98
102
    conf.register_opts(ROOT_HELPER_OPTS, 'AGENT')
99
103
 
100
104
 
119
123
 
120
124
 
121
125
def get_root_helper(conf):
122
 
    root_helper = conf.AGENT.root_helper
123
 
    if root_helper != 'sudo':
124
 
        return root_helper
125
 
 
126
 
    root_helper = conf.root_helper
127
 
    if root_helper != 'sudo':
128
 
        LOG.deprecated(_('DEFAULT.root_helper is deprecated! Please move '
129
 
                         'root_helper configuration to [AGENT] section.'))
130
 
        return root_helper
131
 
 
132
 
    return 'sudo'
 
126
    return conf.AGENT.root_helper
133
127
 
134
128
 
135
129
def setup_conf():