summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-04-07 14:22:05 +0000
committerGerrit Code Review <review@openstack.org>2016-04-07 14:22:08 +0000
commitee803cb4f4a218d2c26f5ab5e190689a9554552d (patch)
tree8939ed6fe85a75261de5898a82c9504721721fe4
parent6b557de25be40c1568c0f0716443f2fd129f8d0a (diff)
parent8407f33ef11c288f7a5071541cd2891ada47cf84 (diff)
downloadnova-ee803cb4f4a218d2c26f5ab5e190689a9554552d.tar.gz
Merge "Config options: Centralize ipv6 options"
-rw-r--r--nova/conf/__init__.py2
-rw-r--r--nova/conf/ipv6.py32
-rw-r--r--nova/ipv6/api.py9
-rw-r--r--nova/opts.py2
4 files changed, 36 insertions, 9 deletions
diff --git a/nova/conf/__init__.py b/nova/conf/__init__.py
index 33f1bf4a46..8b3ec00532 100644
--- a/nova/conf/__init__.py
+++ b/nova/conf/__init__.py
@@ -48,6 +48,7 @@ from nova.conf import hyperv
# from nova.conf import image
# from nova.conf import imagecache
from nova.conf import image_file_url
+from nova.conf import ipv6
from nova.conf import ironic
from nova.conf import keymgr
# from nova.conf import keystone_authtoken
@@ -116,6 +117,7 @@ mks.register_opts(CONF)
# image.register_opts(CONF)
# imagecache.register_opts(CONF)
image_file_url.register_opts(CONF)
+ipv6.register_opts(CONF)
ironic.register_opts(CONF)
keymgr.register_opts(CONF)
# keystone_authtoken.register_opts(CONF)
diff --git a/nova/conf/ipv6.py b/nova/conf/ipv6.py
new file mode 100644
index 0000000000..cc19cc85c0
--- /dev/null
+++ b/nova/conf/ipv6.py
@@ -0,0 +1,32 @@
+# Copyright (c) 2016 Intel, Inc.
+# Copyright (c) 2013 OpenStack Foundation
+# 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
+
+
+ipv6_backend = cfg.StrOpt('ipv6_backend',
+ default='rfc2462',
+ help='Backend to use for IPv6 generation')
+
+IPV6_OPTS = [ipv6_backend]
+
+
+def register_opts(conf):
+ conf.register_opts(IPV6_OPTS)
+
+
+def list_opts():
+ return {'DEFAULT': IPV6_OPTS}
diff --git a/nova/ipv6/api.py b/nova/ipv6/api.py
index 7fedfe8332..478fc1f141 100644
--- a/nova/ipv6/api.py
+++ b/nova/ipv6/api.py
@@ -12,16 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
-from oslo_config import cfg
from stevedore import driver
+import nova.conf
-ipv6_backend_opt = cfg.StrOpt('ipv6_backend',
- default='rfc2462',
- help='Backend to use for IPv6 generation')
-
-CONF = cfg.CONF
-CONF.register_opt(ipv6_backend_opt)
+CONF = nova.conf.CONF
IMPL = None
diff --git a/nova/opts.py b/nova/opts.py
index b352089944..7bef46e412 100644
--- a/nova/opts.py
+++ b/nova/opts.py
@@ -28,7 +28,6 @@ import nova.db.base
import nova.db.sqlalchemy.api
import nova.exception
import nova.image.download.file
-import nova.ipv6.api
import nova.netconf
import nova.paths
import nova.servicegroup.api
@@ -43,7 +42,6 @@ def list_opts():
itertools.chain(
[nova.conductor.tasks.live_migrate.migrate_opt],
[nova.db.base.db_driver_opt],
- [nova.ipv6.api.ipv6_backend_opt],
[nova.servicegroup.api.servicegroup_driver_opt],
nova.console.xvp.xvp_opts,
nova.db.api.db_opts,