diff --git a/ironic/common/swift.py b/ironic/common/swift.py index b5c66c6625..5362571a91 100644 --- a/ironic/common/swift.py +++ b/ironic/common/swift.py @@ -14,7 +14,6 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_config import cfg from six.moves import http_client from six.moves.urllib import parse from swiftclient import client as swift_client @@ -24,17 +23,7 @@ from swiftclient import utils as swift_utils from ironic.common import exception from ironic.common.i18n import _ from ironic.common import keystone - -swift_opts = [ - cfg.IntOpt('swift_max_retries', - default=2, - help=_('Maximum number of times to retry a Swift request, ' - 'before failing.')) -] - - -CONF = cfg.CONF -CONF.register_opts(swift_opts, group='swift') +from ironic.conf import CONF CONF.import_opt('admin_user', 'keystonemiddleware.auth_token', group='keystone_authtoken') diff --git a/ironic/conf/__init__.py b/ironic/conf/__init__.py index 929b9ec173..c2192ecfd9 100644 --- a/ironic/conf/__init__.py +++ b/ironic/conf/__init__.py @@ -31,6 +31,7 @@ from ironic.conf import oneview from ironic.conf import seamicro from ironic.conf import snmp from ironic.conf import ssh +from ironic.conf import swift CONF = cfg.CONF @@ -50,3 +51,4 @@ oneview.register_opts(CONF) seamicro.register_opts(CONF) snmp.register_opts(CONF) ssh.register_opts(CONF) +swift.register_opts(CONF) diff --git a/ironic/conf/opts.py b/ironic/conf/opts.py index 63c65202e2..23c7156918 100644 --- a/ironic/conf/opts.py +++ b/ironic/conf/opts.py @@ -23,7 +23,6 @@ import ironic.common.images import ironic.common.neutron import ironic.common.paths import ironic.common.service -import ironic.common.swift import ironic.common.utils import ironic.drivers.modules.agent import ironic.drivers.modules.agent_base_vendor @@ -85,7 +84,7 @@ _opts = [ ('seamicro', ironic.conf.seamicro.opts), ('snmp', ironic.conf.snmp.opts), ('ssh', ironic.conf.ssh.opts), - ('swift', ironic.common.swift.swift_opts), + ('swift', ironic.conf.swift.opts), ('virtualbox', ironic.drivers.modules.virtualbox.opts), ] diff --git a/ironic/conf/swift.py b/ironic/conf/swift.py new file mode 100644 index 0000000000..66ba9daf3c --- /dev/null +++ b/ironic/conf/swift.py @@ -0,0 +1,30 @@ +# Copyright 2016 Intel Corporation +# Copyright 2014 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 + +from ironic.common.i18n import _ + +opts = [ + cfg.IntOpt('swift_max_retries', + default=2, + help=_('Maximum number of times to retry a Swift request, ' + 'before failing.')) +] + + +def register_opts(conf): + conf.register_opts(opts, group='swift')