summaryrefslogtreecommitdiff
path: root/neutron/conf
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-02-02 04:57:57 +0000
committerGerrit Code Review <review@openstack.org>2023-02-02 04:57:57 +0000
commit2202cc1d89d95b368c65f4968003fd4e0e139af2 (patch)
treef05e1e6bd73022b31c83f5594ea3b8e7e3250e38 /neutron/conf
parent9b3e1971619ef2a5c59c25fafa1e34140bc71453 (diff)
parentd0c7bb653af16ddf310579966d2f6583da866f4c (diff)
downloadneutron-2202cc1d89d95b368c65f4968003fd4e0e139af2.tar.gz
Merge "[OVN] Implementation of OVN Neutron Agent"
Diffstat (limited to 'neutron/conf')
-rw-r--r--neutron/conf/agent/ovn/ovn_neutron_agent/__init__.py0
-rw-r--r--neutron/conf/agent/ovn/ovn_neutron_agent/config.py56
2 files changed, 56 insertions, 0 deletions
diff --git a/neutron/conf/agent/ovn/ovn_neutron_agent/__init__.py b/neutron/conf/agent/ovn/ovn_neutron_agent/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/neutron/conf/agent/ovn/ovn_neutron_agent/__init__.py
diff --git a/neutron/conf/agent/ovn/ovn_neutron_agent/config.py b/neutron/conf/agent/ovn/ovn_neutron_agent/config.py
new file mode 100644
index 0000000000..69c693d0dc
--- /dev/null
+++ b/neutron/conf/agent/ovn/ovn_neutron_agent/config.py
@@ -0,0 +1,56 @@
+# Copyright (c) 2023 Red Hat, 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.
+
+import itertools
+import shlex
+
+from neutron.conf.agent import ovsdb_api
+from neutron.conf.plugins.ml2.drivers.ovn import ovn_conf
+from oslo_config import cfg
+from oslo_privsep import priv_context
+
+from neutron._i18n import _
+
+
+OVS_OPTS = [
+ cfg.IntOpt(
+ 'ovsdb_connection_timeout',
+ default=180,
+ help=_('Timeout in seconds for the OVSDB connection transaction'))
+]
+
+
+def list_ovn_neutron_agent_opts():
+ return [
+ ('ovn', ovn_conf.ovn_opts),
+ ('ovs', itertools.chain(OVS_OPTS,
+ ovsdb_api.API_OPTS,
+ )
+ ),
+ ]
+
+
+def register_opts():
+ cfg.CONF.register_opts(ovn_conf.ovn_opts, group='ovn')
+ cfg.CONF.register_opts(OVS_OPTS, group='ovs')
+ cfg.CONF.register_opts(ovsdb_api.API_OPTS, group='ovs')
+
+
+def get_root_helper(conf):
+ return conf.AGENT.root_helper
+
+
+def setup_privsep():
+ priv_context.init(root_helper=shlex.split(get_root_helper(cfg.CONF)))