def __init__(self): if not importutils.try_import('ravello_sdk'): raise exception.DriverLoadError( driver=self.__class__.__name__, reason="Unable to import ravello_sdk library") self.power = ravello.RavelloPower() self.deploy = fake.FakeDeploy()
def __init__(self): if not importutils.try_import("pyghmi"): raise exception.DriverLoadError(driver=self.__class__.__name__, reason=_("Unable to import pyghmi library")) self.power = ipminative.NativeIPMIPower() self.deploy = pxe.PXEDeploy() self.management = ipminative.NativeIPMIManagement() self.vendor = pxe.VendorPassthru()
def __init__(self): if not importutils.try_import('seamicroclient'): raise exception.DriverLoadError( driver=self.__class__.__name__, reason="Unable to import seamicroclient library") self.power = seamicro.Power() self.deploy = fake.FakeDeploy() self.vendor = seamicro.VendorPassthru()
def __init__(self): if not importutils.try_import('seamicroclient'): raise exception.DriverLoadError( driver=self.__class__.__name__, reason="Unable to import seamicroclient library") self.power = seamicro.Power() self.deploy = fake.FakeDeploy() self.vendor = seamicro.VendorPassthru()
def __init__(self): if not importutils.try_import("pyghmi"): raise exception.DriverLoadError(driver=self.__class__.__name__, reason=_("Unable to import pyghmi library")) self.power = ipminative.NativeIPMIPower() self.deploy = pxe.PXEDeploy() self.pxe_vendor = pxe.VendorPassthru() self.ipmi_vendor = ipminative.VendorPassthru() self.mapping = {"pass_deploy_info": self.pxe_vendor, "set_boot_device": self.ipmi_vendor} self.vendor = utils.MixinVendorInterface(self.mapping)
def __init__(self): if not importutils.try_import('ravello_sdk'): raise exception.DriverLoadError( driver=self.__class__.__name__, reason="Unable to import ravello_sdk library") self.power = ravello.RavelloPower() self.console = ravello.RavelloConsole() self.deploy = pxe.PXEDeploy() self.vendor = pxe.VendorPassthru()
def __init__(self): if not importutils.try_import('pywsman'): raise exception.DriverLoadError( driver=self.__class__.__name__, reason=_('Unable to import pywsman library')) self.power = power.DracPower() self.deploy = pxe.PXEDeploy() self.management = management.DracManagement()
def __init__(self): if not importutils.try_import('seamicroclient'): raise exception.DriverNotFound('FakeSeaMicroDriver') self.power = seamicro.Power() self.deploy = fake.FakeDeploy() self.rescue = self.deploy self.seamicro_vendor = seamicro.VendorPassthru() self.pxe_vendor = pxe.VendorPassthru() self.vendor = seamicro.SeaMicroPXEMultipleVendorInterface( self.seamicro_vendor, self.pxe_vendor)
def __init__(self): if not importutils.try_import('pywsman'): raise exception.DriverLoadError( driver=self.__class__.__name__, reason=_('Unable to import pywsman library')) self.power = power.DracPower() self.deploy = pxe.PXEDeploy() # NOTE(ifarkas): using ipmitool is a temporary solution. It will be # replaced by the DracManagement interface. self.management = ipmitool.IPMIManagement()
def __init__(self): if not importutils.try_import('proliantutils'): raise exception.DriverLoadError( driver=self.__class__.__name__, reason=_("Unable to import proliantutils library")) self.power = power.IloPower() self.deploy = None self.rescue = None self.console = None self.vendor = None
def __init__(self): if not importutils.try_import('seamicroclient'): raise exception.DriverNotFound('PXEAndSeaMicroDriver') self.power = seamicro.Power() self.deploy = pxe.PXEDeploy() self.seamicro_vendor = seamicro.VendorPassthru() self.pxe_vendor = pxe.VendorPassthru() self.mapping = {'pass_deploy_info': self.pxe_vendor, 'attach_volume': self.seamicro_vendor, 'set_boot_device': self.seamicro_vendor, 'set_node_vlan_id': self.seamicro_vendor} self.vendor = utils.MixinVendorInterface(self.mapping)
def __init__(self): if not importutils.try_import('pyghmi'): raise exception.DriverLoadError( driver=self.__class__.__name__, reason=_("Unable to import pyghmi library")) self.power = ipminative.NativeIPMIPower() self.deploy = pxe.PXEDeploy() self.pxe_vendor = pxe.VendorPassthru() self.ipmi_vendor = ipminative.VendorPassthru() self.mapping = {'pass_deploy_info': self.pxe_vendor, 'set_boot_device': self.ipmi_vendor} self.vendor = utils.MixinVendorInterface(self.mapping)
def __init__(self): if not importutils.try_import('proliantutils'): raise exception.DriverLoadError( driver=self.__class__.__name__, reason=_("Unable to import proliantutils library")) self.power = power.IloPower() self.deploy = None self.rescue = None self.console = None self.vendor = None
def __init__(self): if not importutils.try_import('seamicroclient'): raise exception.DriverLoadError( driver=self.__class__.__name__, reason="Unable to import seamicroclient library") self.power = seamicro.Power() self.deploy = pxe.PXEDeploy() self.management = seamicro.Management() self.seamicro_vendor = seamicro.VendorPassthru() self.pxe_vendor = pxe.VendorPassthru() self.mapping = {'pass_deploy_info': self.pxe_vendor, 'attach_volume': self.seamicro_vendor, 'set_node_vlan_id': self.seamicro_vendor} self.vendor = utils.MixinVendorInterface(self.mapping)
def __init__(self): if not importutils.try_import('seamicroclient'): raise exception.DriverLoadError( driver=self.__class__.__name__, reason="Unable to import seamicroclient library") self.power = seamicro.Power() self.deploy = pxe.PXEDeploy() self.seamicro_vendor = seamicro.VendorPassthru() self.pxe_vendor = pxe.VendorPassthru() self.mapping = {'pass_deploy_info': self.pxe_vendor, 'attach_volume': self.seamicro_vendor, 'set_boot_device': self.seamicro_vendor, 'set_node_vlan_id': self.seamicro_vendor} self.vendor = utils.MixinVendorInterface(self.mapping)
def __init__(self): if not importutils.try_import('seamicroclient'): raise exception.DriverNotFound('PXEAndSeaMicroDriver') self.power = seamicro.Power() self.deploy = pxe.PXEDeploy() self.seamicro_vendor = seamicro.VendorPassthru() self.pxe_vendor = pxe.VendorPassthru() self.mapping = { 'pass_deploy_info': self.pxe_vendor, 'attach_volume': self.seamicro_vendor, 'set_boot_device': self.seamicro_vendor, 'set_node_vlan_id': self.seamicro_vendor } self.vendor = utils.MixinVendorInterface(self.mapping)
def __init__(self): if not importutils.try_import("seamicroclient"): raise exception.DriverLoadError( driver=self.__class__.__name__, reason="Unable to import seamicroclient library" ) self.power = seamicro.Power() self.deploy = pxe.PXEDeploy() self.management = seamicro.Management() self.seamicro_vendor = seamicro.VendorPassthru() self.pxe_vendor = pxe.VendorPassthru() self.mapping = { "pass_deploy_info": self.pxe_vendor, "attach_volume": self.seamicro_vendor, "set_node_vlan_id": self.seamicro_vendor, } self.vendor = utils.MixinVendorInterface(self.mapping)
import signal import sys import time import eventlet from eventlet import event from oslo.config import cfg from ironic.openstack.common import eventlet_backdoor from ironic.openstack.common.gettextutils import _ # noqa from ironic.openstack.common import importutils from ironic.openstack.common import log as logging from ironic.openstack.common import threadgroup rpc = importutils.try_import('ironic.openstack.common.rpc') CONF = cfg.CONF LOG = logging.getLogger(__name__) def _sighup_supported(): return hasattr(signal, 'SIGHUP') def _is_sighup(signo): return _sighup_supported() and signo == signal.SIGHUP def _signo_to_signame(signo): signals = {signal.SIGTERM: 'SIGTERM', signal.SIGINT: 'SIGINT'}
seamicroclient ipminative proliantutils """ import sys import mock from ironic.drivers.modules import ipmitool from ironic.openstack.common import importutils # attempt to load the external 'seamicroclient' library, which is # required by the optional drivers.modules.seamicro module seamicroclient = importutils.try_import("seamicroclient") if not seamicroclient: smc = mock.Mock() smc.client = mock.Mock() smc.exceptions = mock.Mock() smc.exceptions.ClientException = Exception sys.modules['seamicroclient'] = smc sys.modules['seamicroclient.client'] = smc.client sys.modules['seamicroclient.exceptions'] = smc.exceptions # if anything has loaded the seamicro driver yet, reload it now that # the external library has been mocked if 'ironic.drivers.modules.seamicro' in sys.modules: reload(sys.modules['ironic.drivers.modules.seamicro']) # IPMITool driver checks the system for presense of 'ipmitool' binary during
import itertools import json try: import xmlrpclib except ImportError: # NOTE(jd): xmlrpclib is not shipped with Python 3 xmlrpclib = None import six from ironic.openstack.common import gettextutils from ironic.openstack.common import importutils from ironic.openstack.common import timeutils netaddr = importutils.try_import("netaddr") _nasty_type_tests = [ inspect.ismodule, inspect.isclass, inspect.ismethod, inspect.isfunction, inspect.isgeneratorfunction, inspect.isgenerator, inspect.istraceback, inspect.isframe, inspect.iscode, inspect.isbuiltin, inspect.isroutine, inspect.isabstract, ]
except ImportError: # Python 2.6 UnsupportedOperation = None import eventlet from eventlet import event from oslo.config import cfg from ironic.openstack.common import eventlet_backdoor from ironic.openstack.common.gettextutils import _LE, _LI, _LW from ironic.openstack.common import importutils from ironic.openstack.common import log as logging from ironic.openstack.common import systemd from ironic.openstack.common import threadgroup rpc = importutils.try_import('ironic.openstack.common.rpc') CONF = cfg.CONF LOG = logging.getLogger(__name__) def _sighup_supported(): return hasattr(signal, 'SIGHUP') def _is_daemon(): # The process group for a foreground process will match the # process group of the controlling terminal. If those values do # not match, or ioctl() fails on the stdout file handle, we assume # the process is running in the background as a daemon. # http://www.gnu.org/software/bash/manual/bashref.html#Job-Control-Basics try:
# under the License. """ Ironic Native IPMI power manager. """ from oslo.config import cfg from ironic.common import exception from ironic.common import states from ironic.conductor import task_manager from ironic.drivers import base from ironic.openstack.common import importutils from ironic.openstack.common import log as logging pyghmi = importutils.try_import('pyghmi') if pyghmi: from pyghmi import exceptions as pyghmi_exception from pyghmi.ipmi import command as ipmi_command opts = [ cfg.IntOpt('retry_timeout', default=60, help='Maximum time in seconds to retry IPMI operations.'), cfg.IntOpt('min_command_interval', default=5, help='Minimum time, in seconds, between IPMI operations ' 'sent to a server. There is a risk with some hardware ' 'that setting this too low may cause the BMC to crash. ' 'Recommended setting is 5 seconds.'), ]
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ Ironic iBoot PDU power manager. """ from ironic.common import exception from ironic.common import states from ironic.conductor import task_manager from ironic.drivers import base from ironic.openstack.common import importutils from ironic.openstack.common import log as logging iboot = importutils.try_import('iboot') LOG = logging.getLogger(__name__) REQUIRED_PROPERTIES = { 'iboot_address': _("IP address of the node. Required."), 'iboot_username': _("username. Required."), 'iboot_password': _("password. Required."), } OPTIONAL_PROPERTIES = { 'iboot_relay_id': _("iBoot PDU relay id; default is 1. Optional."), 'iboot_port': _("iBoot PDU port; default is 9100. Optional."), } COMMON_PROPERTIES = REQUIRED_PROPERTIES.copy() COMMON_PROPERTIES.update(OPTIONAL_PROPERTIES)
import itertools import time import uuid import eventlet import greenlet from oslo.config import cfg from ironic.openstack.common.gettextutils import _ from ironic.openstack.common import importutils from ironic.openstack.common import jsonutils from ironic.openstack.common import log as logging from ironic.openstack.common.rpc import amqp as rpc_amqp from ironic.openstack.common.rpc import common as rpc_common qpid_messaging = importutils.try_import("qpid.messaging") qpid_exceptions = importutils.try_import("qpid.messaging.exceptions") LOG = logging.getLogger(__name__) qpid_opts = [ cfg.StrOpt('qpid_hostname', default='localhost', help='Qpid broker hostname'), cfg.IntOpt('qpid_port', default=5672, help='Qpid broker port'), cfg.ListOpt('qpid_hosts', default=['$qpid_hostname:$qpid_port'], help='Qpid HA cluster host:port pairs'), cfg.StrOpt('qpid_username', default='', help='Username for qpid connection'),
# 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. """ The MatchMaker classes should accept a Topic or Fanout exchange key and return keys for direct exchanges, per (approximate) AMQP parlance. """ from oslo.config import cfg from ironic.openstack.common import importutils from ironic.openstack.common import log as logging from ironic.openstack.common.rpc import matchmaker as mm_common redis = importutils.try_import('redis') matchmaker_redis_opts = [ cfg.StrOpt('host', default='127.0.0.1', help='Host to locate redis'), cfg.IntOpt('port', default=6379, help='Use this port to connect to redis host.'), cfg.StrOpt('password', default=None, help='Password for Redis server. (optional)'), ] CONF = cfg.CONF opt_group = cfg.OptGroup(name='matchmaker_redis', title='Options for Redis-based MatchMaker') CONF.register_group(opt_group)
import inspect import itertools import json try: import xmlrpclib except ImportError: # NOTE(jd): xmlrpclib is not shipped with Python 3 xmlrpclib = None import six from ironic.openstack.common import gettextutils from ironic.openstack.common import importutils from ironic.openstack.common import timeutils netaddr = importutils.try_import("netaddr") _nasty_type_tests = [ inspect.ismodule, inspect.isclass, inspect.ismethod, inspect.isfunction, inspect.isgeneratorfunction, inspect.isgenerator, inspect.istraceback, inspect.isframe, inspect.iscode, inspect.isbuiltin, inspect.isroutine, inspect.isabstract ] _simple_types = (six.string_types + six.integer_types + (type(None), bool, float)) def to_primitive(value, convert_instances=False, convert_datetime=True,
from ironic.conductor import task_manager from ironic.conductor import utils as manager_utils from ironic.drivers.modules import agent from ironic.drivers.modules import deploy_utils from ironic.drivers.modules.ilo import common as ilo_common from ironic.drivers.modules.ilo import deploy as ilo_deploy from ironic.drivers.modules import iscsi_deploy from ironic.drivers.modules import pxe from ironic.drivers import utils as driver_utils from ironic.openstack.common import importutils from ironic.tests.conductor import utils as mgr_utils from ironic.tests.db import base as db_base from ironic.tests.db import utils as db_utils from ironic.tests.objects import utils as obj_utils ilo_client = importutils.try_import('proliantutils.ilo.ribcl') INFO_DICT = db_utils.get_test_ilo_info() CONF = cfg.CONF class IloDeployPrivateMethodsTestCase(db_base.DbTestCase): def setUp(self): super(IloDeployPrivateMethodsTestCase, self).setUp() mgr_utils.mock_the_extension_manager(driver="iscsi_ilo") self.node = obj_utils.create_test_node(self.context, driver='iscsi_ilo', driver_info=INFO_DICT) def test__get_boot_iso_object_name(self): boot_iso_actual = ilo_deploy._get_boot_iso_object_name(self.node)
import types import uuid import eventlet import greenlet from oslo.config import cfg import six from six import moves from ironic.openstack.common import excutils from ironic.openstack.common.gettextutils import _ from ironic.openstack.common import importutils from ironic.openstack.common import jsonutils from ironic.openstack.common.rpc import common as rpc_common zmq = importutils.try_import("eventlet.green.zmq") # for convenience, are not modified. pformat = pprint.pformat Timeout = eventlet.timeout.Timeout LOG = rpc_common.LOG RemoteError = rpc_common.RemoteError RPCException = rpc_common.RPCException zmq_opts = [ cfg.StrOpt( "rpc_zmq_bind_address", default="*", help="ZeroMQ bind address. Should be a wildcard (*), " "an ethernet interface, or IP. " 'The "host" option should point or resolve to this '
def __init__(self): if not importutils.try_import("iboot"): raise exception.DriverLoadError(driver=self.__class__.__name__, reason="Unable to import iboot library") self.power = iboot.IBootPower() self.deploy = pxe.PXEDeploy() self.vendor = pxe.VendorPassthru()
import time import eventlet import greenlet from oslo.config import cfg import six from ironic.openstack.common import excutils from ironic.openstack.common.gettextutils import _ from ironic.openstack.common import importutils from ironic.openstack.common import jsonutils from ironic.openstack.common import log as logging from ironic.openstack.common.rpc import amqp as rpc_amqp from ironic.openstack.common.rpc import common as rpc_common qpid_codec = importutils.try_import("qpid.codec010") qpid_messaging = importutils.try_import("qpid.messaging") qpid_exceptions = importutils.try_import("qpid.messaging.exceptions") LOG = logging.getLogger(__name__) qpid_opts = [ cfg.StrOpt('qpid_hostname', default='localhost', help='Qpid broker hostname'), cfg.IntOpt('qpid_port', default=5672, help='Qpid broker port'), cfg.ListOpt('qpid_hosts', default=['$qpid_hostname:$qpid_port'], help='Qpid HA cluster host:port pairs'),
# 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. """ Wrapper for pywsman.Client """ from xml.etree import ElementTree from ironic.common import exception from ironic.openstack.common import importutils pywsman = importutils.try_import('pywsman') _SOAP_ENVELOPE_URI = 'http://www.w3.org/2003/05/soap-envelope' class Client(object): def __init__(self, drac_host, drac_port, drac_path, drac_protocol, drac_username, drac_password): pywsman_client = pywsman.Client(drac_host, drac_port, drac_path, drac_protocol, drac_username, drac_password) # TODO(ifarkas): Add support for CACerts pywsman.wsman_transport_set_verify_peer(pywsman_client, False) self.client = pywsman_client
from ironic.common import driver_factory from ironic.common import exception from ironic.common import states from ironic.conductor import task_manager from ironic.db import api as dbapi from ironic.drivers.modules import seamicro from ironic.openstack.common import importutils from ironic.tests import base from ironic.tests.conductor import utils as mgr_utils from ironic.tests.db import base as db_base from ironic.tests.db import utils as db_utils INFO_DICT = db_utils.get_test_seamicro_info() seamicroclient = importutils.try_import("seamicroclient") if seamicroclient: from seamicroclient import exceptions as seamicro_client_exception class Fake_Server(): def __init__(self, active=False, *args, **kwargs): self.active = active self.nic = {'0': {'untaggedVlan': ''}} def power_on(self): self.active = True def power_off(self, force=False): self.active = False
python-seamicroclient. Provides vendor passthru methods for SeaMicro specific functionality. """ from oslo.config import cfg from ironic.common import exception from ironic.common import states from ironic.conductor import task_manager from ironic.drivers import base from ironic.openstack.common import importutils from ironic.openstack.common import log as logging from ironic.openstack.common import loopingcall seamicroclient = importutils.try_import('seamicroclient') 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',
Ravello power and console drivers for Ironic. """ import socket from contextlib import closing from oslo.config import cfg from ironic.common import exception from ironic.common import states from ironic.openstack.common import importutils from ironic.conductor import task_manager from ironic.drivers import base from ironic.openstack.common import log as logging ravello_sdk = importutils.try_import('ravello_sdk') if ravello_sdk: from ravello_sdk import RavelloClient from ravello_sdk import RavelloError ravello_opts = [ cfg.StrOpt('username', help='Ravello API username.'), cfg.StrOpt('password', help='Ravello API password.'), cfg.StrOpt('endpoint', default='https://cloud.ravellosystems.com/api/v1', help='Ravello API endpoint.'), ]
import types import uuid import eventlet import greenlet from oslo.config import cfg import six from six import moves from ironic.openstack.common import excutils from ironic.openstack.common.gettextutils import _ from ironic.openstack.common import importutils from ironic.openstack.common import jsonutils from ironic.openstack.common.rpc import common as rpc_common zmq = importutils.try_import('eventlet.green.zmq') # for convenience, are not modified. pformat = pprint.pformat Timeout = eventlet.timeout.Timeout LOG = rpc_common.LOG RemoteError = rpc_common.RemoteError RPCException = rpc_common.RPCException zmq_opts = [ cfg.StrOpt('rpc_zmq_bind_address', default='*', help='ZeroMQ bind address. Should be a wildcard (*), ' 'an ethernet interface, or IP. ' 'The "host" option should point or resolve to this ' 'address.'),
Current list of mocked libraries: seamicroclient ipminative """ import sys import mock from ironic.drivers.modules import ipmitool from ironic.openstack.common import importutils # attempt to load the external 'seamicroclient' library, which is # required by the optional drivers.modules.seamicro module seamicroclient = importutils.try_import("seamicroclient") if not seamicroclient: smc = mock.Mock() smc.client = mock.Mock() smc.exceptions = mock.Mock() smc.exceptions.ClientException = Exception sys.modules['seamicroclient'] = smc sys.modules['seamicroclient.client'] = smc.client sys.modules['seamicroclient.exceptions'] = smc.exceptions # if anything has loaded the seamicro driver yet, reload it now that # the external library has been mocked if 'ironic.drivers.modules.seamicro' in sys.modules: reload(sys.modules['ironic.drivers.modules.seamicro']) # IPMITool driver checks the system for presense of 'ipmitool' binary during
import sys import types import uuid import eventlet import greenlet from oslo.config import cfg from ironic.openstack.common import excutils from ironic.openstack.common.gettextutils import _ from ironic.openstack.common import importutils from ironic.openstack.common import jsonutils from ironic.openstack.common import processutils as utils from ironic.openstack.common.rpc import common as rpc_common zmq = importutils.try_import('eventlet.green.zmq') # for convenience, are not modified. pformat = pprint.pformat Timeout = eventlet.timeout.Timeout LOG = rpc_common.LOG RemoteError = rpc_common.RemoteError RPCException = rpc_common.RPCException zmq_opts = [ cfg.StrOpt('rpc_zmq_bind_address', default='*', help='ZeroMQ bind address. Should be a wildcard (*), ' 'an ethernet interface, or IP. ' 'The "host" option should point or resolve to this ' 'address.'),
def __init__(self): if not importutils.try_import('seamicroclient'): raise exception.DriverNotFound('FakeSeaMicroDriver') self.power = seamicro.Power() self.deploy = fake.FakeDeploy() self.vendor = seamicro.VendorPassthru()
python-seamicroclient. Provides vendor passthru methods for SeaMicro specific functionality. """ from oslo.config import cfg from ironic.common import exception from ironic.common import states from ironic.conductor import task_manager from ironic.drivers import base from ironic.openstack.common import importutils from ironic.openstack.common import log as logging from ironic.openstack.common import loopingcall seamicroclient = importutils.try_import('seamicroclient') 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',
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ The MatchMaker classes should accept a Topic or Fanout exchange key and return keys for direct exchanges, per (approximate) AMQP parlance. """ from oslo.config import cfg from ironic.openstack.common import importutils from ironic.openstack.common import log as logging from ironic.openstack.common.rpc import matchmaker as mm_common redis = importutils.try_import('redis') matchmaker_redis_opts = [ cfg.StrOpt('host', default='127.0.0.1', help='Host to locate redis'), cfg.IntOpt('port', default=6379, help='Use this port to connect to redis host.'), cfg.StrOpt('password', default=None, help='Password for Redis server. (optional)'), ] CONF = cfg.CONF
from ironic.conductor import task_manager from ironic.conductor import utils as manager_utils from ironic.drivers.modules import agent from ironic.drivers.modules import deploy_utils from ironic.drivers.modules.ilo import common as ilo_common from ironic.drivers.modules.ilo import deploy as ilo_deploy from ironic.drivers.modules import iscsi_deploy from ironic.drivers.modules import pxe from ironic.drivers import utils as driver_utils from ironic.openstack.common import importutils from ironic.tests.conductor import utils as mgr_utils from ironic.tests.db import base as db_base from ironic.tests.db import utils as db_utils from ironic.tests.objects import utils as obj_utils ilo_client = importutils.try_import('proliantutils.ilo.ribcl') INFO_DICT = db_utils.get_test_ilo_info() CONF = cfg.CONF class IloDeployPrivateMethodsTestCase(db_base.DbTestCase): def setUp(self): super(IloDeployPrivateMethodsTestCase, self).setUp() mgr_utils.mock_the_extension_manager(driver="iscsi_ilo") self.node = obj_utils.create_test_node(self.context, driver='iscsi_ilo', driver_info=INFO_DICT) def test__get_boot_iso_object_name(self):
# 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. """ The MatchMaker classes should accept a Topic or Fanout exchange key and return keys for direct exchanges, per (approximate) AMQP parlance. """ from oslo.config import cfg from ironic.openstack.common import importutils from ironic.openstack.common import log as logging from ironic.openstack.common.rpc import matchmaker as mm_common redis = importutils.try_import("redis") matchmaker_redis_opts = [ cfg.StrOpt("host", default="127.0.0.1", help="Host to locate redis"), cfg.IntOpt("port", default=6379, help="Use this port to connect to redis host."), cfg.StrOpt("password", default=None, help="Password for Redis server. (optional)"), ] CONF = cfg.CONF opt_group = cfg.OptGroup(name="matchmaker_redis", title="Options for Redis-based MatchMaker") CONF.register_group(opt_group) CONF.register_opts(matchmaker_redis_opts, opt_group) LOG = logging.getLogger(__name__)