Replace incomplete "ilo" driver with pxe_ilo and fake_ilo

The "ilo" driver is not complete -- it only has a PowerInterface today.

This patch removes it from setup.cfg, deletes the drivers/ilo.py module,
and adds both PXEAndIloDriver and FakeIloDriver instead.

Change-Id: I431fd5155d0696a0a48ad8decf9f5317c5fcd7a2
This commit is contained in:
Devananda van der Veen 2014-08-11 11:53:59 -07:00
parent 868aacdc21
commit 55858be5f8
6 changed files with 40 additions and 50 deletions
ironic
drivers
tests
conductor
drivers/ilo
setup.cfg

@ -24,6 +24,7 @@ from ironic.drivers import base
from ironic.drivers.modules import agent
from ironic.drivers.modules import fake
from ironic.drivers.modules import iboot
from ironic.drivers.modules.ilo import power as ilo_power
from ironic.drivers.modules import ipminative
from ironic.drivers.modules import ipmitool
from ironic.drivers.modules import pxe
@ -115,3 +116,15 @@ class FakeIBootDriver(base.BaseDriver):
def __init__(self):
self.power = iboot.IBootPower()
self.deploy = fake.FakeDeploy()
class FakeIloDriver(base.BaseDriver):
"""Fake iLO driver, used in testing."""
def __init__(self):
if not importutils.try_import('proliantutils'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import proliantutils library"))
self.power = ilo_power.IloPower()
self.deploy = fake.FakeDeploy()

@ -1,43 +0,0 @@
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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.
"""
iLO Driver for managing HP Proliant Gen8 and above servers.
"""
from oslo.utils import importutils
from ironic.common import exception
from ironic.drivers import base
from ironic.drivers.modules.ilo import power
class IloDriver(base.BaseDriver):
"""IloDriver using IloClient interface.
This driver implements the `core` functionality using
:class:ironic.drivers.modules.ilo.power.IloPower for power management.
"""
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

@ -22,6 +22,7 @@ from oslo.utils import importutils
from ironic.common import exception
from ironic.drivers import base
from ironic.drivers.modules import iboot
from ironic.drivers.modules.ilo import power as ilo_power
from ironic.drivers.modules import ipminative
from ironic.drivers.modules import ipmitool
from ironic.drivers.modules import pxe
@ -134,3 +135,21 @@ class PXEAndIBootDriver(base.BaseDriver):
self.power = iboot.IBootPower()
self.deploy = pxe.PXEDeploy()
self.vendor = pxe.VendorPassthru()
class PXEAndIloDriver(base.BaseDriver):
"""PXE + Ilo Driver using IloClient interface.
This driver implements the `core` functionality using
:class:ironic.drivers.modules.ilo.power.IloPower for power management
and :class:ironic.drivers.modules.pxe.PXE for image deployment.
"""
def __init__(self):
if not importutils.try_import('proliantutils'):
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import proliantutils library"))
self.power = ilo_power.IloPower()
self.deploy = pxe.PXEDeploy()
self.vendor = pxe.VendorPassthru()

@ -2156,10 +2156,10 @@ class ManagerTestProperties(tests_db_base.DbTestCase):
'seamicro_api_version']
self._check_driver_properties("pxe_seamicro", expected)
def test_driver_properties_ilo(self):
def test_driver_properties_fake_ilo(self):
expected = ['ilo_address', 'ilo_username', 'ilo_password',
'client_port', 'client_timeout']
self._check_driver_properties("ilo", expected)
self._check_driver_properties("fake_ilo", expected)
def test_driver_properties_fail(self):
mgr_utils.mock_the_extension_manager()

@ -44,9 +44,9 @@ class IloPowerInternalMethodsTestCase(base.TestCase):
def setUp(self):
super(IloPowerInternalMethodsTestCase, self).setUp()
driver_info = INFO_DICT
mgr_utils.mock_the_extension_manager(driver="ilo")
mgr_utils.mock_the_extension_manager(driver="fake_ilo")
n = db_utils.get_test_node(
driver='ilo',
driver='fake_ilo',
driver_info=driver_info,
instance_uuid='instance_uuid_123')
self.dbapi = dbapi.get_instance()
@ -143,10 +143,10 @@ class IloPowerTestCase(base.TestCase):
self.context = context.get_admin_context()
super(IloPowerTestCase, self).setUp()
driver_info = INFO_DICT
mgr_utils.mock_the_extension_manager(driver="ilo")
mgr_utils.mock_the_extension_manager(driver="fake_ilo")
self.dbapi = dbapi.get_instance()
self.node = obj_utils.create_test_node(self.context,
driver='ilo',
driver='fake_ilo',
driver_info=driver_info)
def test_get_properties(self):

@ -41,12 +41,13 @@ ironic.drivers =
fake_pxe = ironic.drivers.fake:FakePXEDriver
fake_seamicro = ironic.drivers.fake:FakeSeaMicroDriver
fake_iboot = ironic.drivers.fake:FakeIBootDriver
fake_ilo = ironic.drivers.fake:FakeIloDriver
pxe_ipmitool = ironic.drivers.pxe:PXEAndIPMIToolDriver
pxe_ipminative = ironic.drivers.pxe:PXEAndIPMINativeDriver
pxe_ssh = ironic.drivers.pxe:PXEAndSSHDriver
pxe_seamicro = ironic.drivers.pxe:PXEAndSeaMicroDriver
pxe_iboot = ironic.drivers.pxe:PXEAndIBootDriver
ilo = ironic.drivers.ilo:IloDriver
pxe_ilo = ironic.drivers.pxe:PXEAndIloDriver
[pbr]
autodoc_index_modules = True