diff --git a/ironic/conf/__init__.py b/ironic/conf/__init__.py index 4c18407c7d..7478c32ea9 100644 --- a/ironic/conf/__init__.py +++ b/ironic/conf/__init__.py @@ -15,8 +15,10 @@ from oslo_config import cfg +from ironic.conf import cimc from ironic.conf import console CONF = cfg.CONF +cimc.register_opts(CONF) console.register_opts(CONF) diff --git a/ironic/conf/cimc.py b/ironic/conf/cimc.py new file mode 100644 index 0000000000..ba4c2547ab --- /dev/null +++ b/ironic/conf/cimc.py @@ -0,0 +1,33 @@ +# Copyright 2016 Intel Corporation +# Copyright 2015, Cisco Systems. +# +# 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('max_retry', + default=6, + help=_('Number of times a power operation needs to be ' + 'retried')), + cfg.IntOpt('action_interval', + default=10, + help=_('Amount of time in seconds to wait in between power ' + 'operations')), +] + + +def register_opts(conf): + conf.register_opts(opts, group='cimc') diff --git a/ironic/conf/opts.py b/ironic/conf/opts.py index fe5a67b2de..8fa22e0e6f 100644 --- a/ironic/conf/opts.py +++ b/ironic/conf/opts.py @@ -35,7 +35,6 @@ import ironic.drivers.modules.agent_base_vendor import ironic.drivers.modules.agent_client import ironic.drivers.modules.amt.common import ironic.drivers.modules.amt.power -import ironic.drivers.modules.cimc.power import ironic.drivers.modules.deploy_utils import ironic.drivers.modules.iboot import ironic.drivers.modules.ilo.common @@ -80,7 +79,7 @@ _opts = [ ironic.drivers.modules.amt.common.opts, ironic.drivers.modules.amt.power.opts)), ('api', ironic.api.API_SERVICE_OPTS), - ('cimc', ironic.drivers.modules.cimc.power.opts), + ('cimc', ironic.conf.cimc.opts), ('cisco_ucs', ironic.drivers.modules.ucs.power.opts), ('conductor', itertools.chain( ironic.conductor.base_manager.conductor_opts, diff --git a/ironic/drivers/modules/cimc/power.py b/ironic/drivers/modules/cimc/power.py index 72de00ab9f..39a4ae4435 100644 --- a/ironic/drivers/modules/cimc/power.py +++ b/ironic/drivers/modules/cimc/power.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from oslo_config import cfg from oslo_service import loopingcall from oslo_utils import importutils @@ -20,25 +19,12 @@ from ironic.common import exception from ironic.common.i18n import _ from ironic.common import states from ironic.conductor import task_manager +from ironic.conf import CONF from ironic.drivers import base from ironic.drivers.modules.cimc import common imcsdk = importutils.try_import('ImcSdk') -opts = [ - cfg.IntOpt('max_retry', - default=6, - help=_('Number of times a power operation needs to be ' - 'retried')), - cfg.IntOpt('action_interval', - default=10, - help=_('Amount of time in seconds to wait in between power ' - 'operations')), -] - -CONF = cfg.CONF -CONF.register_opts(opts, group='cimc') - if imcsdk: CIMC_TO_IRONIC_POWER_STATE = {