diff --git a/ironic/conf/__init__.py b/ironic/conf/__init__.py index 9b5fa53d70..7e5703b91a 100644 --- a/ironic/conf/__init__.py +++ b/ironic/conf/__init__.py @@ -28,6 +28,7 @@ from ironic.conf import ipmi from ironic.conf import irmc from ironic.conf import keystone from ironic.conf import oneview +from ironic.conf import seamicro CONF = cfg.CONF @@ -44,3 +45,4 @@ ipmi.register_opts(CONF) irmc.register_opts(CONF) keystone.register_opts(CONF) oneview.register_opts(CONF) +seamicro.register_opts(CONF) diff --git a/ironic/conf/opts.py b/ironic/conf/opts.py index 691aa8d2f6..07853b871a 100644 --- a/ironic/conf/opts.py +++ b/ironic/conf/opts.py @@ -34,7 +34,6 @@ import ironic.drivers.modules.deploy_utils import ironic.drivers.modules.image_cache import ironic.drivers.modules.iscsi_deploy import ironic.drivers.modules.pxe -import ironic.drivers.modules.seamicro import ironic.drivers.modules.snmp import ironic.drivers.modules.ssh import ironic.drivers.modules.virtualbox @@ -85,7 +84,7 @@ _opts = [ ('pxe', itertools.chain( ironic.drivers.modules.iscsi_deploy.pxe_opts, ironic.drivers.modules.pxe.pxe_opts)), - ('seamicro', ironic.drivers.modules.seamicro.opts), + ('seamicro', ironic.conf.seamicro.opts), ('snmp', ironic.drivers.modules.snmp.opts), ('ssh', ironic.drivers.modules.ssh.libvirt_opts), ('swift', ironic.common.swift.swift_opts), diff --git a/ironic/conf/seamicro.py b/ironic/conf/seamicro.py new file mode 100644 index 0000000000..8211122459 --- /dev/null +++ b/ironic/conf/seamicro.py @@ -0,0 +1,34 @@ +# 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.IntOpt('max_retry', + default=3, + help=_('Maximum retries for SeaMicro operations')), + cfg.IntOpt('action_timeout', + default=10, + help=_('Seconds to wait for power action to be completed')) +] + +opt_group = cfg.OptGroup(name='seamicro', + title='Options for the seamicro power driver') + + +def register_opts(conf): + conf.register_group(opt_group) + conf.register_opts(opts, group=opt_group) diff --git a/ironic/drivers/modules/seamicro.py b/ironic/drivers/modules/seamicro.py index 82e1005146..02b05378e1 100644 --- a/ironic/drivers/modules/seamicro.py +++ b/ironic/drivers/modules/seamicro.py @@ -21,7 +21,6 @@ Provides vendor passthru methods for SeaMicro specific functionality. import os import re -from oslo_config import cfg from oslo_log import log as logging from oslo_service import loopingcall from oslo_utils import importutils @@ -36,6 +35,7 @@ from ironic.common.i18n import _LW from ironic.common import states from ironic.common import utils from ironic.conductor import task_manager +from ironic.conf import CONF from ironic.drivers import base from ironic.drivers.modules import console_utils @@ -44,21 +44,6 @@ if seamicroclient: from seamicroclient import client as seamicro_client from seamicroclient import exceptions as seamicro_client_exception -opts = [ - cfg.IntOpt('max_retry', - default=3, - help=_('Maximum retries for SeaMicro operations')), - cfg.IntOpt('action_timeout', - default=10, - help=_('Seconds to wait for power action to be completed')) -] - -CONF = cfg.CONF -opt_group = cfg.OptGroup(name='seamicro', - title='Options for the seamicro power driver') -CONF.register_group(opt_group) -CONF.register_opts(opts, opt_group) - LOG = logging.getLogger(__name__) _BOOT_DEVICES_MAP = {