Renamed ovs_vsctl_timeout into ovsdb_timeout

It's not specific to cli implementation of ovsdb interface.

Also moved the option under [agent] section.

Change-Id: Ic5e38d0c36ae29a9fef23038a9262d14ef1ede90
This commit is contained in:
Ihar Hrachyshka 2017-11-07 12:06:23 -08:00
parent 95fd904184
commit a82d945f9f
5 changed files with 25 additions and 15 deletions

View File

@ -109,7 +109,7 @@ class VifPort(object):
class BaseOVS(object):
def __init__(self):
self.vsctl_timeout = cfg.CONF.ovs_vsctl_timeout
self.vsctl_timeout = cfg.CONF.OVS.ovsdb_timeout
self.ovsdb = ovsdb_api.from_config(self)
def add_manager(self, connection_uri, timeout=_SENTINEL):
@ -117,10 +117,10 @@ class BaseOVS(object):
:param connection_uri: Manager target string
:param timeout: The Manager probe_interval timeout value
(defaults to ovs_vsctl_timeout)
(defaults to ovsdb_timeout)
"""
if timeout is _SENTINEL:
timeout = cfg.CONF.ovs_vsctl_timeout
timeout = cfg.CONF.OVS.ovsdb_timeout
with self.ovsdb.transaction() as txn:
txn.add(self.ovsdb.add_manager(connection_uri))
if timeout:

View File

@ -45,12 +45,12 @@ def api_factory(context):
try:
_connection = connection.Connection(
idl=n_connection.idl_factory(),
timeout=cfg.CONF.ovs_vsctl_timeout)
timeout=cfg.CONF.OVS.ovsdb_timeout)
except TypeError:
#pylint: disable=unexpected-keyword-arg,no-value-for-parameter
_connection = connection.Connection(
idl_factory=n_connection.idl_factory, # noqa
timeout=cfg.CONF.ovs_vsctl_timeout)
timeout=cfg.CONF.OVS.ovsdb_timeout)
return NeutronOvsdbIdl(_connection)

View File

@ -17,17 +17,18 @@ from oslo_config import cfg
from neutron._i18n import _
# Default timeout for ovs-vsctl command
DEFAULT_OVS_VSCTL_TIMEOUT = 10
# Default timeout for ovsdb commands
DEFAULT_OVSDB_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 '
cfg.IntOpt('ovsdb_timeout',
default=DEFAULT_OVSDB_TIMEOUT,
deprecated_name='ovs_vsctl_timeout', deprecated_group='DEFAULT',
help=_('Timeout in seconds for ovsdb commands. '
'If the timeout expires, ovsdb commands will fail with '
'ALARMCLOCK error.')),
]
def register_ovs_agent_opts(cfg=cfg.CONF):
cfg.register_opts(OPTS)
cfg.register_opts(OPTS, 'OVS')

View File

@ -147,11 +147,14 @@ def list_base_agent_opts():
('DEFAULT',
itertools.chain(
neutron.conf.agent.common.INTERFACE_OPTS,
neutron.conf.agent.common.INTERFACE_DRIVER_OPTS,
neutron.conf.agent.ovs_conf.OPTS)
neutron.conf.agent.common.INTERFACE_DRIVER_OPTS)
),
('agent', neutron.conf.agent.common.AGENT_STATE_OPTS),
('ovs', neutron.conf.agent.ovsdb_api.API_OPTS),
('ovs',
itertools.chain(
neutron.conf.agent.ovsdb_api.API_OPTS,
neutron.conf.agent.ovs_conf.OPTS)
),
]

View File

@ -0,0 +1,6 @@
---
deprecations:
- |
The ``ovs_vsctl_timeout`` option is renamed into ``ovsdb_timeout`` to
reflect that it's not specific to ``vsctl`` implementation of
``ovsdb_interface``. It is also moved under ``[OVS]`` section.