Centralize config options - [keystone]
Nova style refactor of config options in Ironic. Change-Id: Ic95322f3a0c7bc36ed7f8def0c1aba7f4e813882 Partial-Bug: #1561100
This commit is contained in:
@@ -14,21 +14,12 @@
|
||||
|
||||
from keystoneclient import exceptions as ksexception
|
||||
from oslo_concurrency import lockutils
|
||||
from oslo_config import cfg
|
||||
from six.moves.urllib import parse
|
||||
|
||||
from ironic.common import exception
|
||||
from ironic.common.i18n import _
|
||||
from ironic.conf import CONF
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
keystone_opts = [
|
||||
cfg.StrOpt('region_name',
|
||||
help=_('The region used for getting endpoints of OpenStack'
|
||||
' services.')),
|
||||
]
|
||||
|
||||
CONF.register_opts(keystone_opts, group='keystone')
|
||||
CONF.import_group('keystone_authtoken', 'keystonemiddleware.auth_token')
|
||||
|
||||
_KS_CLIENT = None
|
||||
|
||||
@@ -26,6 +26,7 @@ from ironic.conf import ilo
|
||||
from ironic.conf import inspector
|
||||
from ironic.conf import ipmi
|
||||
from ironic.conf import irmc
|
||||
from ironic.conf import keystone
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
@@ -40,3 +41,4 @@ ilo.register_opts(CONF)
|
||||
inspector.register_opts(CONF)
|
||||
ipmi.register_opts(CONF)
|
||||
irmc.register_opts(CONF)
|
||||
keystone.register_opts(CONF)
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# Copyright 2016 Intel Corporation
|
||||
#
|
||||
# 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 ironic.common.i18n import _
|
||||
|
||||
opts = [
|
||||
cfg.StrOpt('region_name',
|
||||
help=_('The region used for getting endpoints of OpenStack'
|
||||
' services.')),
|
||||
]
|
||||
|
||||
|
||||
def register_opts(conf):
|
||||
conf.register_opts(opts, group='keystone')
|
||||
+1
-2
@@ -20,7 +20,6 @@ import ironic.common.glance_service.v2.image_service
|
||||
import ironic.common.hash_ring
|
||||
import ironic.common.image_service
|
||||
import ironic.common.images
|
||||
import ironic.common.keystone
|
||||
import ironic.common.neutron
|
||||
import ironic.common.paths
|
||||
import ironic.common.service
|
||||
@@ -81,7 +80,7 @@ _opts = [
|
||||
('ipmi', ironic.conf.ipmi.opts),
|
||||
('irmc', ironic.conf.irmc.opts),
|
||||
('iscsi', ironic.drivers.modules.iscsi_deploy.iscsi_opts),
|
||||
('keystone', ironic.common.keystone.keystone_opts),
|
||||
('keystone', ironic.conf.keystone.opts),
|
||||
('neutron', ironic.common.neutron.neutron_opts),
|
||||
('oneview', ironic.drivers.modules.oneview.common.opts),
|
||||
('pxe', itertools.chain(
|
||||
|
||||
Reference in New Issue
Block a user