diff --git a/neutron/agent/common/ovs_lib.py b/neutron/agent/common/ovs_lib.py index c50e2853ea0..e90a0f75772 100644 --- a/neutron/agent/common/ovs_lib.py +++ b/neutron/agent/common/ovs_lib.py @@ -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: diff --git a/neutron/agent/ovsdb/impl_idl.py b/neutron/agent/ovsdb/impl_idl.py index e8d4086fa68..a42f6517f00 100644 --- a/neutron/agent/ovsdb/impl_idl.py +++ b/neutron/agent/ovsdb/impl_idl.py @@ -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) diff --git a/neutron/conf/agent/ovs_conf.py b/neutron/conf/agent/ovs_conf.py index 85a5ab6549b..c0cdd244981 100644 --- a/neutron/conf/agent/ovs_conf.py +++ b/neutron/conf/agent/ovs_conf.py @@ -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') diff --git a/neutron/opts.py b/neutron/opts.py index 56e71e651eb..9346620a17e 100644 --- a/neutron/opts.py +++ b/neutron/opts.py @@ -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) + ), ] diff --git a/releasenotes/notes/rename-ovs-vsctl-timeout-9df1967c47f394c0.yaml b/releasenotes/notes/rename-ovs-vsctl-timeout-9df1967c47f394c0.yaml new file mode 100644 index 00000000000..993cc1c615e --- /dev/null +++ b/releasenotes/notes/rename-ovs-vsctl-timeout-9df1967c47f394c0.yaml @@ -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.