Merge "Refactoring config options of agent/common/ovs_lib"

This commit is contained in:
Jenkins 2016-08-02 18:09:51 +00:00 committed by Gerrit Code Review
commit 26bbc783d2
4 changed files with 38 additions and 14 deletions

View File

@ -30,15 +30,13 @@ from neutron._i18n import _, _LE, _LI, _LW
from neutron.agent.common import utils
from neutron.agent.linux import ip_lib
from neutron.agent.ovsdb import api as ovsdb
from neutron.conf.agent import ovs_conf
from neutron.plugins.common import constants as p_const
from neutron.plugins.ml2.drivers.openvswitch.agent.common \
import constants
UINT64_BITMASK = (1 << 64) - 1
# Default timeout for ovs-vsctl command
DEFAULT_OVS_VSCTL_TIMEOUT = 10
# Special return value for an invalid OVS ofport
INVALID_OFPORT = -1
UNASSIGNED_OFPORT = []
@ -47,14 +45,7 @@ UNASSIGNED_OFPORT = []
FAILMODE_SECURE = 'secure'
FAILMODE_STANDALONE = 'standalone'
OPTS = [
cfg.IntOpt('ovs_vsctl_timeout',
default=DEFAULT_OVS_VSCTL_TIMEOUT,
help=_('Timeout in seconds for ovs-vsctl commands. '
'If the timeout expires, ovs commands will fail with '
'ALARMCLOCK error.')),
]
cfg.CONF.register_opts(OPTS)
ovs_conf.register_ovs_agent_opts()
LOG = logging.getLogger(__name__)

View File

@ -28,7 +28,7 @@ from neutron.agent.ovsdb.native import connection
from neutron.agent.ovsdb.native import idlutils
cfg.CONF.import_opt('ovs_vsctl_timeout', 'neutron.agent.common.ovs_lib')
cfg.CONF.import_opt('ovs_vsctl_timeout', 'neutron.conf.agent.ovs_conf')
LOG = logging.getLogger(__name__)

View File

@ -0,0 +1,33 @@
# Copyright 2011 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oslo_config import cfg
from neutron._i18n import _
# Default timeout for ovs-vsctl command
DEFAULT_OVS_VSCTL_TIMEOUT = 10
OPTS = [
cfg.IntOpt('ovs_vsctl_timeout',
default=DEFAULT_OVS_VSCTL_TIMEOUT,
help=_('Timeout in seconds for ovs-vsctl commands. '
'If the timeout expires, ovs commands will fail with '
'ALARMCLOCK error.')),
]
def register_ovs_agent_opts(cfg=cfg.CONF):
cfg.register_opts(OPTS)

View File

@ -19,7 +19,6 @@ from oslo_config import cfg
import neutron.agent.agent_extensions_manager
import neutron.agent.common.config
import neutron.agent.common.ovs_lib
import neutron.agent.l3.config
import neutron.agent.l3.ha
import neutron.agent.linux.interface
@ -31,6 +30,7 @@ import neutron.agent.securitygroups_rpc
import neutron.common.cache_utils
import neutron.conf.agent.dhcp
import neutron.conf.agent.l3.config
import neutron.conf.agent.ovs_conf
import neutron.conf.common
import neutron.conf.quota
import neutron.conf.service
@ -157,7 +157,7 @@ def list_base_agent_opts():
itertools.chain(
neutron.agent.linux.interface.OPTS,
neutron.agent.common.config.INTERFACE_DRIVER_OPTS,
neutron.agent.common.ovs_lib.OPTS)
neutron.conf.agent.ovs_conf.OPTS)
),
('AGENT',
itertools.chain(