Remove classic drivers

Support for them was removed from ironic, so we have to remove them.

Change-Id: I27c61a01184b1d5435e05efa3c65eae90c9d3b34
This commit is contained in:
Dmitry Tantsur 2018-05-11 19:14:31 +02:00
parent a1eba0a010
commit f3c9cab07f
22 changed files with 161 additions and 544 deletions

View File

@ -14,13 +14,8 @@ AMT drivers use WS-MAN protocol to interact with AMT clients.
They work on AMT 7.0/8.0/9.0. AMT 7.0 was released in 2010, so AMT drivers
should work on most PCs with vPro.
There are two AMT drivers:
* ``pxe_amt_iscsi`` uses AMT for power management and deploys the user image
over iSCSI from the conductor.
* ``pxe_amt_agent`` uses AMT for power management and deploys the user image
directly to the node via HTTP.
The ``staging-amt`` hardware type uses AMT for power and boot device
management.
Set up your environment
=======================
@ -63,10 +58,16 @@ A short guide follows below:
* Or build it yourself from: https://github.com/Openwsman/openwsman
* Enable the ``pxe_amt_iscsi`` or ``pxe_amt_agent`` driver by adding it to the
configuration option ``enabled_drivers`` (typically located at
``/etc/ironic/ironic.conf``) and restart the ``ironic-conductor``
process::
* Enable the ``staging-amt`` hardware type, power, deploy and management
interfaces, for example::
[DEFAULT]
enabled_hardware_types = staging-amt,ipmi
enabled_deploy_interfaces = staging-amt,iscsi,direct
enabled_management_interfaces = staging-amt,ipmitool
enabled_power_interfaces = staging-amt,ipmitool
and restart the ``ironic-conductor`` process::
service ironic-conductor restart

View File

@ -9,48 +9,39 @@ Overview
The iBoot power driver enables you to take advantage of power cycle
management of nodes using Dataprobe iBoot devices over the DxP protocol.
Drivers
=======
There are two iboot drivers:
* The ``pxe_iboot_iscsi`` driver uses iBoot to control the power state of the
node, PXE/iPXE technology for booting and the iSCSI methodology for
deploying the node.
* The ``pxe_iboot_agent`` driver uses iBoot to control the power state of the
node, PXE/iPXE technology for booting and the Ironic Python Agent for
deploying an image to the node.
The ``staging-iboot`` hardware type uses iBoot to manage power of the nodes.
Requirements
~~~~~~~~~~~~
------------
* ``python-iboot`` library should be installed - https://github.com/darkip/python-iboot
Tested platforms
~~~~~~~~~~~~~~~~
----------------
* iBoot-G2
* iBoot-G2 [1]_
Configuring and enabling the driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Configuring and enabling
------------------------
1. Add ``pxe_iboot_iscsi`` and/or ``pxe_iboot_agent`` to the list of
``enabled_drivers`` in */etc/ironic/ironic.conf*. For example::
1. Add ``staging-iboot`` to ``enabled_hardware_types`` and
``enabled_power_interfaces`` in */etc/ironic/ironic.conf*. Also enable
the ``fake`` management interface. For example::
[DEFAULT]
...
enabled_drivers = pxe_iboot_iscsi,pxe_iboot_agent
enabled_hardware_types = staging-iboot,ipmi
enabled_management_interfaces = fake,ipmitool
enabled_power_interfaces = staging-iboot,ipmitool
2. Restart the Ironic conductor service::
service ironic-conductor restart
Registering a node with the iBoot driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Registering a node
------------------
Nodes configured for the iBoot driver should have the ``driver`` property
set to ``pxe_iboot_iscsi`` or ``pxe_iboot_agent``.
set to ``staging-iboot``.
The following configuration values are also required in ``driver_info``:
@ -69,7 +60,10 @@ the iBoot driver.
1. Create node::
ironic node-create -d pxe_iboot_iscsi -i iboot_username=<username> -i iboot_password=<password> -i iboot_address=<address>
openstack baremetal node create --driver staging-iboot \
--driver-info iboot_username=<username> \
--driver-info iboot_password=<password> \
--driver-info iboot_address=<address>
References
==========

View File

@ -18,18 +18,8 @@ boot time. Each policy identified by ``policy_id`` (integer number from 0 to
255). Maximum numbers of policies which can be set at the same time limited by
platform. For more detailed information see full specification [1]_.
Available drivers
=================
Driver provided by ironic-staging-drivers are
``agent_ipmitool_nm``
Standard Ironic's ``agent_ipmitool`` driver with Intel NodeManager
as vendor extension
``fake_nm``
Used for testing of this vendor passthru extension.
The ``staging-nm`` hardware types extends the ``ipmi`` hardware type with
support for the ``staging-nm`` vendor interface.
Supported vendor passthru methods
=================================

View File

@ -37,9 +37,15 @@ Setting up the environment
in your system
(on DevStack, those are already installed when nova-compute is enabled).
#. Add desired driver(s) to the list of ``enabled_drivers`` in ironic.conf
(see `Available drivers and options`_)
and restart ironic-conductor service.
#. Add ``staging-libvirt`` to the list of ``enabled_hardware_types``
in ironic.conf, configure the power and management interfaces, for example::
[DEFAULT]
enabled_hardware_types = staging-libvirt
enabled_management_interfaces = staging-libvirt
enabled_power_interfaces = staging-libvirt
Then restart the ironic-conductor service.
#. Create or update existing virtual baremetal nodes to use one of
libvirt-based drivers enabled in the previous step.
#. Update node properties with driver-specific fields if needed.
@ -47,28 +53,6 @@ Setting up the environment
Default values are suitable for single-node DevStack.
#. Deploy the node.
Available drivers and options
=============================
Several drivers are provided by Ironic-staging drivers
pxe_libvirt_agent
Uses PXE to Boot interface, Libvirt for Power/Management and Agent deploy
pxe_libvirt_iscsi
Uses PXE to Boot interface, Libvirt for Power/Management and ISCSI deploy
fake_libvirt_fake
This driver is used for testing of Libvirt Power/Management driver
interfaces themselves.
As for all Ironic drivers, you can easily create your own collection of driver
interfaces to suit your needs and register that as Ironic driver.
Config
------
These driver interfaces have no specific options in Ironic configuration file.
Node driver_info
----------------

View File

@ -26,43 +26,32 @@ the Ironic database. Any calls to the API to get the power state of the
node will return the value from the Ironic's database.
Drivers
=======
pxe_wol_iscsi
^^^^^^^^^^^^^
Overview
~~~~~~~~
The ``pxe_wol_iscsi`` driver uses the Wake-On-Lan technology to control the
power state, PXE/iPXE technology for booting and the iSCSI methodology
for deploying the node.
Requirements
~~~~~~~~~~~~
============
* Wake-On-Lan should be enabled in the BIOS
Configuring and Enabling the driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Configuring and Enabling
========================
1. Add ``pxe_wol_iscsi`` to the list of ``enabled_drivers`` in
*/etc/ironic/ironic.conf*. For example::
1. Add ``staging-wol`` to the list of ``enabled_hardware_types`` in
*/etc/ironic/ironic.conf*. Also enable the ``staging-wol`` power
interface and the ``fake`` management interface. For example::
[DEFAULT]
...
enabled_drivers = pxe_ipmitool,pxe_wol_iscsi
enabled_hardware_types = staging-wol,ipmi
enabled_management_interfaces = fake,ipmi
enabled_power_interfaces = staging-wol,ipmitool
2. Restart the Ironic conductor service::
service ironic-conductor restart
Registering a node with the Wake-On-Lan driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Registering a node
==================
Nodes configured for Wake-On-Lan driver should have the ``driver``
property set to ``pxe_wol_iscsi``.
property set to ``staging-wol``.
The node should have at least one port registered with it because the
Wake-On-Lan driver will use the MAC address of the ports to create the
@ -86,26 +75,16 @@ the Wake-On-Lan driver.
1. Create node::
ironic node-create -d pxe_wol_iscsi [-i wol_host=<broadcast ip> [ -i
wol_port=<destination port>]]
openstack baremetal node create --driver staging-wol \
--driver-info wol_host=<broadcast ip> \
--driver-info wol_port=<destination port>
The above command ``ironic node-create`` will return UUID of the node,
which is the value of *$NODE* in the following command.
2. Associate port with the node created::
ironic port-create -n $NODE -a <MAC address>
pxe_wol_agent
^^^^^^^^^^^^^
Overview
~~~~~~~~
The ``pxe_wol_agent`` driver uses the Wake-On-Lan technology to control
the power state, PXE/iPXE technology for booting and the Ironic Python
Agent for deploying the node.
openstack baremetal port create --node $NODE <MAC address>
Additional requirements
~~~~~~~~~~~~~~~~~~~~~~~
@ -118,12 +97,9 @@ Additional requirements
* Node should be powered off before start of deploy
Configuration steps are the same as for ``pxe_wol_iscsi`` driver, replace
"pxe_wol_iscsi" with "pxe_wol_agent".
References
==========
.. [1] Wake-On-Lan - https://en.wikipedia.org/wiki/Wake-on-LAN
.. [2] Magic packet - https://en.wikipedia.org/wiki/Wake-on-LAN#Sending_the_magic_packet
.. [3] Ironic node cleaning - http://docs.openstack.org/developer/ironic/deploy/cleaning.html
.. [3] Ironic node cleaning - https://docs.openstack.org/ironic/latest/admin/cleaning.html

View File

@ -13,85 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from ironic.common import exception as ironic_exception
from ironic.drivers import base
from ironic.drivers import generic
from ironic.drivers.modules import agent
from ironic.drivers.modules import fake
from ironic.drivers.modules import pxe
from oslo_log import log as logging
from oslo_utils import importutils
from ironic_staging_drivers.amt import deploy as amt_deploy
from ironic_staging_drivers.amt import management as amt_management
from ironic_staging_drivers.amt import power as amt_power
from ironic_staging_drivers.common.i18n import _
LOG = logging.getLogger(__name__)
# NOTE(lintan) There is a strange behavior for tox if put below classes
# in __init__.py. It will reload pywsman and set it to None. So place
# them here at moment.
class FakeAMTFakeDriver(base.BaseDriver):
"""Fake AMT driver."""
def __init__(self):
self.boot = fake.FakeBoot()
self.power = amt_power.AMTPower()
self.deploy = fake.FakeDeploy()
self.management = amt_management.AMTManagement()
class PXEAndAMTISCSIDriver(base.BaseDriver):
"""PXE + AMT + iSCSI driver.
This driver implements the `core` functionality, combining
:class:`ironic.drivers.modules.pxe.PXEBoot` for boot and
:class:`ironic_staging_drivers.amt.AMTPower` for power on/off and
:class:`ironic.drivers.modules.iscsi_deploy.ISCSIDeploy` for image
deployment. Implementations are in those respective classes; this
class is merely the glue between them.
"""
def __init__(self):
LOG.warning("This driver is deprecated and will be removed "
"in the Rocky release. "
"Use 'staging-amt' hardware type instead.")
if not importutils.try_import('pywsman'):
raise ironic_exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import pywsman library"))
self.power = amt_power.AMTPower()
self.boot = pxe.PXEBoot()
self.deploy = amt_deploy.AMTISCSIDeploy()
self.management = amt_management.AMTManagement()
class PXEAndAMTAgentDriver(base.BaseDriver):
"""PXE + AMT + Agent driver.
This driver implements the `core` functionality, combining
:class:`ironic.drivers.modules.pxe.PXEBoot` for boot and
:class:`ironic_staging_drivers.amt.AMTPower` for power on/off and
:class:`ironic.drivers.modules.agent_deploy.AgentDeploy` for image
deployment. Implementations are in those respective classes; this
class is merely the glue between them.
"""
def __init__(self):
LOG.warning("This driver is deprecated and will be removed "
"in the Rocky release. "
"Use 'staging-amt' hardware type instead.")
if not importutils.try_import('pywsman'):
raise ironic_exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import pywsman library"))
self.power = amt_power.AMTPower()
self.boot = pxe.PXEBoot()
self.deploy = agent.AgentDeploy()
self.management = amt_management.AMTManagement()
class AMTHardware(generic.GenericHardware):

View File

@ -14,80 +14,11 @@
# under the License.
from ironic.common import exception as ironic_exception
from ironic.common.i18n import _
from ironic.drivers import base
from ironic.drivers import generic
from ironic.drivers.modules import agent
from ironic.drivers.modules import fake
from ironic.drivers.modules import iscsi_deploy
from ironic.drivers.modules import pxe
from oslo_log import log as logging
from oslo_utils import importutils
from ironic_staging_drivers.iboot import power as iboot_power
LOG = logging.getLogger(__name__)
class FakeIBootFakeDriver(base.BaseDriver):
"""Fake iBoot driver."""
def __init__(self):
if not importutils.try_import('iboot'):
raise ironic_exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import iboot library"))
self.boot = fake.FakeBoot()
self.power = iboot_power.IBootPower()
self.deploy = fake.FakeDeploy()
class PXEIBootISCSIDriver(base.BaseDriver):
"""PXE + IBoot PDU driver + iSCSI driver.
This driver implements the `core` functionality, combining
:class:`ironic.drivers.modules.pxe.PXEBoot` for boot and
:class:`ironic_staging_drivers.iboot.power.IBootPower` for power
and :class:`ironic.drivers.modules.iscsi_deploy.ISCSIDeploy` for
image deployment. Implementations are in those respective classes;
this class is merely the glue between them.
"""
def __init__(self):
LOG.warning("This driver is deprecated and will be removed "
"in the Rocky release. "
"Use 'staging-iboot' hardware type instead.")
if not importutils.try_import('iboot'):
raise ironic_exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import iboot library"))
self.power = iboot_power.IBootPower()
self.boot = pxe.PXEBoot()
self.deploy = iscsi_deploy.ISCSIDeploy()
class PXEIBootAgentDriver(base.BaseDriver):
"""PXE + IBoot PDU driver + Agent driver.
This driver implements the `core` functionality, combining
:class:`ironic.drivers.modules.pxe.PXEBoot` for boot and
:class:`ironic_staging_drivers.iboot.power.IBootPower` for power
and :class:'ironic.driver.modules.agent.AgentDeploy' for image
deployment. Implementations are in those respective classes;
this class is merely the glue between them.
"""
def __init__(self):
LOG.warning("This driver is deprecated and will be removed "
"in the Rocky release. "
"Use 'staging-iboot' hardware type instead.")
if not importutils.try_import('iboot'):
raise ironic_exception.DriverLoadError(
driver=self.__class__.__name__,
reason=_("Unable to import iboot library"))
self.power = iboot_power.IBootPower()
self.boot = pxe.PXEBoot()
self.deploy = agent.AgentDeploy()
class IBootHardware(generic.GenericHardware):
"""IBoot hardware type.

View File

@ -10,61 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from ironic.drivers import base
from ironic.drivers import ipmi
from ironic.drivers.modules import agent
from ironic.drivers.modules import fake
from ironic.drivers.modules import inspector
from ironic.drivers.modules import ipmitool
from ironic.drivers.modules import pxe
from ironic.drivers import utils
from oslo_log import log as logging
from ironic_staging_drivers.intel_nm import nm_vendor
LOG = logging.getLogger(__name__)
class FakeIntelNMDriver(base.BaseDriver):
"""Fake Intel NM driver."""
def __init__(self):
self.power = fake.FakePower()
self.deploy = fake.FakeDeploy()
self.vendor = nm_vendor.IntelNMVendorPassthru()
class AgentAndIPMIToolIntelNMDriver(base.BaseDriver):
"""Agent + IPMITool driver with Intel NM policies."""
def __init__(self):
LOG.warning("This driver is deprecated and will be removed "
"in the Rocky release. "
"Use 'staging-nm' hardware type instead.")
self.power = ipmitool.IPMIPower()
self.boot = pxe.PXEBoot()
self.deploy = agent.AgentDeploy()
self.management = ipmitool.IPMIManagement()
self.console = ipmitool.IPMIShellinaboxConsole()
self.ipmi_vendor = ipmitool.VendorPassthru()
self.nm_vendor = nm_vendor.IntelNMVendorPassthru()
self.mapping = {'send_raw': self.ipmi_vendor,
'bmc_reset': self.ipmi_vendor,
'control_nm_policy': self.nm_vendor,
'set_nm_policy': self.nm_vendor,
'get_nm_policy': self.nm_vendor,
'remove_nm_policy': self.nm_vendor,
'set_nm_policy_suspend': self.nm_vendor,
'get_nm_policy_suspend': self.nm_vendor,
'remove_nm_policy_suspend': self.nm_vendor,
'get_nm_capabilities': self.nm_vendor,
'get_nm_version': self.nm_vendor,
'get_nm_statistics': self.nm_vendor,
'reset_nm_statistics': self.nm_vendor}
self.vendor = utils.MixinVendorInterface(self.mapping)
self.raid = agent.AgentRAID()
self.inspect = inspector.Inspector.create_if_enabled(
'AgentAndIPMIToolDriver')
class IntelNMHardware(ipmi.IPMIHardware):
"""Intel NM hardware type.

View File

@ -10,72 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from ironic.drivers import base
from ironic.drivers import generic
from ironic.drivers.modules import agent
from ironic.drivers.modules import fake
from ironic.drivers.modules import iscsi_deploy
from ironic.drivers.modules import pxe
from oslo_log import log as logging
from ironic_staging_drivers.libvirt import power
LOG = logging.getLogger(__name__)
class FakeLibvirtFakeDriver(base.BaseDriver):
"""Example implementation of a Driver."""
def __init__(self):
self.power = power.LibvirtPower()
self.deploy = fake.FakeDeploy()
self.management = power.LibvirtManagement()
class PXELibvirtAgentDriver(base.BaseDriver):
"""PXE + Agent + Libvirt driver.
NOTE: This driver is meant only for testing environments.
This driver implements the `core` functionality, combining
:class:`ironic.drivers.modules.power.LibvirtPower` (for power on/off and
reboot of virtual machines tunneled over Libvirt API), with
:class:`ironic.drivers.modules.agent.AgentDeploy` (for image
deployment). Implementations are in those respective classes; this class
is merely the glue between them.
"""
def __init__(self):
LOG.warning("This driver is deprecated and will be removed "
"in the Rocky release. "
"Use 'staging-libvirt' hardware type instead.")
self.power = power.LibvirtPower()
self.boot = pxe.PXEBoot()
self.deploy = agent.AgentDeploy()
self.management = power.LibvirtManagement()
self.raid = agent.AgentRAID()
class PXELibvirtISCSIDriver(base.BaseDriver):
"""PXE + Libvirt + iSCSI driver.
This driver implements the `core` functionality, combining
:class:`ironic.drivers.modules.pxe.PXEBoot` for boot and
:class:`ironic_staging_drivers.libvirt.LibvirtPower` for power on/off and
:class:`ironic.drivers.modules.iscsi_deploy.ISCSIDeploy` for image
deployment. Implementations are in those respective classes; this
class is merely the glue between them.
"""
def __init__(self):
LOG.warning("This driver is deprecated and will be removed "
"in the Rocky release. "
"Use 'staging-libvirt' hardware type instead.")
self.power = power.LibvirtPower()
self.boot = pxe.PXEBoot()
self.deploy = iscsi_deploy.ISCSIDeploy()
self.management = power.LibvirtManagement()
class LibvirtHardware(generic.GenericHardware):
"""Libvirt hardware type.

View File

@ -19,8 +19,6 @@ import time
from ironic.common import exception as ironic_exception
from ironic.common import utils
from ironic.tests import base
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.objects import utils as obj_utils
import mock
from oslo_concurrency import processutils
from oslo_config import cfg
@ -32,17 +30,11 @@ from ironic_staging_drivers.tests.unit.amt import pywsman_mocks_specs \
as mock_specs
from ironic_staging_drivers.tests.unit.amt import utils as test_utils
INFO_DICT = test_utils.get_test_amt_info()
CONF = cfg.CONF
INFO_DICT = test_utils.get_test_amt_info()
class AMTCommonMethodsTestCase(db_base.DbTestCase):
def setUp(self):
super(AMTCommonMethodsTestCase, self).setUp()
self.node = obj_utils.create_test_node(self.context,
driver='fake_amt_fake',
driver_info=INFO_DICT)
class AMTCommonMethodsTestCase(test_utils.BaseAMTTest):
def test_parse_driver_info(self):
info = amt_common.parse_driver_info(self.node)
@ -176,14 +168,10 @@ class AMTCommonClientTestCase(base.TestCase):
mock_pywsman.invoke.assert_called_once_with(options, namespace, method)
class AwakeAMTInterfaceTestCase(db_base.DbTestCase):
class AwakeAMTInterfaceTestCase(test_utils.BaseAMTTest):
def setUp(self):
super(AwakeAMTInterfaceTestCase, self).setUp()
amt_common.AMT_AWAKE_CACHE = {}
self.info = INFO_DICT
self.node = obj_utils.create_test_node(self.context,
driver='fake_amt',
driver_info=self.info)
@mock.patch.object(utils, 'execute', spec_set=True, autospec=True)
def test_awake_amt_interface(self, mock_ex):

View File

@ -17,23 +17,15 @@ from ironic.common import boot_devices
from ironic.common import states
from ironic.conductor import task_manager
from ironic.drivers.modules import iscsi_deploy
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.objects import utils as obj_utils
import mock
from ironic_staging_drivers.amt import management as amt_mgmt
from ironic_staging_drivers.tests.unit.amt import utils as test_utils
INFO_DICT = test_utils.get_test_amt_info()
class AMTISCSIDeployTestCase(test_utils.BaseAMTTest):
class AMTISCSIDeployTestCase(db_base.DbTestCase):
def setUp(self):
super(AMTISCSIDeployTestCase, self).setUp()
self.config(enabled_drivers=["pxe_amt_iscsi"])
self.node = obj_utils.create_test_node(
self.context, driver='pxe_amt_iscsi', driver_info=INFO_DICT)
deploy_interface = 'staging-amt'
@mock.patch.object(amt_mgmt.AMTManagement, 'ensure_next_boot_device',
spec_set=True, autospec=True)

View File

@ -18,8 +18,6 @@ Test class for AMT ManagementInterface
from ironic.common import boot_devices
from ironic.common import exception as ironic_exception
from ironic.conductor import task_manager
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.objects import utils as obj_utils
import mock
from oslo_config import cfg
@ -31,19 +29,11 @@ from ironic_staging_drivers.tests.unit.amt import pywsman_mocks_specs \
as mock_specs
from ironic_staging_drivers.tests.unit.amt import utils as test_utils
INFO_DICT = test_utils.get_test_amt_info()
CONF = cfg.CONF
@mock.patch.object(amt_common, 'pywsman', spec_set=mock_specs.PYWSMAN_SPEC)
class AMTManagementInteralMethodsTestCase(db_base.DbTestCase):
def setUp(self):
super(AMTManagementInteralMethodsTestCase, self).setUp()
self.config(enabled_drivers=['fake_amt_fake'])
self.node = obj_utils.create_test_node(self.context,
driver='fake_amt_fake',
driver_info=INFO_DICT)
class AMTManagementInteralMethodsTestCase(test_utils.BaseAMTTest):
@mock.patch.object(amt_common, 'awake_amt_interface', spec_set=True,
autospec=True)
@ -124,15 +114,7 @@ class AMTManagementInteralMethodsTestCase(db_base.DbTestCase):
self.assertTrue(mock_aw.called)
class AMTManagementTestCase(db_base.DbTestCase):
def setUp(self):
super(AMTManagementTestCase, self).setUp()
self.config(enabled_drivers=['fake_amt_fake'])
self.info = INFO_DICT
self.node = obj_utils.create_test_node(self.context,
driver='fake_amt_fake',
driver_info=self.info)
class AMTManagementTestCase(test_utils.BaseAMTTest):
def test_get_properties(self):
expected = amt_common.COMMON_PROPERTIES

View File

@ -19,8 +19,6 @@ from ironic.common import boot_devices
from ironic.common import exception as ironic_exception
from ironic.common import states
from ironic.conductor import task_manager
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.objects import utils as obj_utils
import mock
from oslo_config import cfg
@ -32,19 +30,13 @@ from ironic_staging_drivers.amt import resource_uris
from ironic_staging_drivers.common import exception
from ironic_staging_drivers.tests.unit.amt import utils as test_utils
INFO_DICT = test_utils.get_test_amt_info()
CONF = cfg.CONF
class AMTPowerInteralMethodsTestCase(db_base.DbTestCase):
class AMTPowerInteralMethodsTestCase(test_utils.BaseAMTTest):
def setUp(self):
super(AMTPowerInteralMethodsTestCase, self).setUp()
self.config(enabled_drivers=['fake_amt_fake'])
self.info = INFO_DICT
self.node = obj_utils.create_test_node(self.context,
driver='fake_amt_fake',
driver_info=self.info)
CONF.set_override('max_attempts', 2, 'amt_driver')
CONF.set_override('action_wait', 0, 'amt_driver')
@ -216,15 +208,7 @@ class AMTPowerInteralMethodsTestCase(db_base.DbTestCase):
mock_ps.assert_called_with(task.node)
class AMTPowerTestCase(db_base.DbTestCase):
def setUp(self):
super(AMTPowerTestCase, self).setUp()
self.config(enabled_drivers=['fake_amt_fake'])
self.info = INFO_DICT
self.node = obj_utils.create_test_node(self.context,
driver='fake_amt_fake',
driver_info=self.info)
class AMTPowerTestCase(test_utils.BaseAMTTest):
def test_get_properties(self):
expected = amt_common.COMMON_PROPERTIES

View File

@ -15,6 +15,8 @@
from xml.etree import ElementTree
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.objects import utils as obj_utils
import mock
@ -77,3 +79,21 @@ def mock_wsman_root(return_value):
mock_xml.root.return_value = mock_xml_root
return mock_xml
class BaseAMTTest(db_base.DbTestCase):
deploy_interface = None
def setUp(self):
super(BaseAMTTest, self).setUp()
self.config(enabled_hardware_types=['staging-amt'],
enabled_power_interfaces=['staging-amt'],
enabled_management_interfaces=['staging-amt'],
enabled_deploy_interfaces=['staging-amt', 'direct'])
self.info = get_test_amt_info()
self.node = obj_utils.create_test_node(
self.context,
driver='staging-amt',
driver_info=self.info,
deploy_interface=self.deploy_interface)

View File

@ -19,10 +19,10 @@ import types
import mock
from ironic.common import driver_factory
from ironic.common import exception as ironic_exception
from ironic.common import states
from ironic.conductor import task_manager
from ironic.drivers.modules import fake
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.objects import utils as obj_utils
@ -261,11 +261,11 @@ class IBootDriverTestCase(db_base.DbTestCase):
self.config(max_retry=0, group='iboot')
self.config(retry_interval=0, group='iboot')
self.config(reboot_delay=0, group='iboot')
self.config(enabled_drivers=['fake_iboot_fake'])
self.driver = driver_factory.get_driver('fake_iboot_fake')
self.config(enabled_hardware_types=['staging-iboot'],
enabled_power_interfaces=['staging-iboot'])
self.node = obj_utils.create_test_node(
self.context,
driver='fake_iboot_fake',
driver='staging-iboot',
driver_info=INFO_DICT)
self.info = iboot_power._parse_driver_info(self.node)
@ -273,6 +273,9 @@ class IBootDriverTestCase(db_base.DbTestCase):
expected = iboot_power.COMMON_PROPERTIES
with task_manager.acquire(
self.context, self.node.uuid, shared=True) as task:
# Remove properties from the boot and deploy interfaces
task.driver.boot = fake.FakeBoot()
task.driver.deploy = fake.FakeDeploy()
self.assertEqual(expected, task.driver.get_properties())
@mock.patch.object(iboot_power.LOG, 'warning')

View File

@ -65,8 +65,12 @@ class IntelNMPassthruTestCase(db_base.DbTestCase):
def setUp(self):
super(IntelNMPassthruTestCase, self).setUp()
self.config(enabled_drivers=['fake_nm'])
self.node = obj_utils.create_test_node(self.context, driver='fake_nm')
self.config(enabled_hardware_types=['staging-nm'],
enabled_vendor_interfaces=['staging-nm'],
enabled_power_interfaces=['ipmitool'],
enabled_management_interfaces=['ipmitool'])
self.node = obj_utils.create_test_node(self.context,
driver='staging-nm')
self.temp_filename = os.path.join(CONF.tempdir, self.node.uuid +
'.sdr')

View File

@ -21,7 +21,6 @@ import tempfile
import mock
from ironic.common import boot_devices
from ironic.common import driver_factory
from ironic.common import exception
from ironic.common import states
from ironic.conductor import task_manager
@ -107,7 +106,15 @@ class FakeConnection(object):
return [FakeLibvirtDomain()]
class LibvirtValidateParametersTestCase(db_base.DbTestCase):
class BaseLibvirtTest(db_base.DbTestCase):
def setUp(self):
super(BaseLibvirtTest, self).setUp()
self.config(enabled_hardware_types=['staging-libvirt'],
enabled_power_interfaces=['staging-libvirt'],
enabled_management_interfaces=['staging-libvirt'])
class LibvirtValidateParametersTestCase(BaseLibvirtTest):
def test__parse_driver_info_good_ssh_key(self):
d_info = _get_test_libvirt_driver_info('ssh_key')
@ -116,7 +123,7 @@ class LibvirtValidateParametersTestCase(db_base.DbTestCase):
d_info['ssh_key_filename'] = key_path
node = obj_utils.get_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=d_info)
info = power._parse_driver_info(node)
@ -128,7 +135,7 @@ class LibvirtValidateParametersTestCase(db_base.DbTestCase):
def test__parse_driver_info_no_ssh_key(self):
node = obj_utils.get_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('ssh_key'))
self.assertRaises(exception.InvalidParameterValue,
@ -138,7 +145,7 @@ class LibvirtValidateParametersTestCase(db_base.DbTestCase):
def test__parse_driver_info_good_sasl_cred(self):
node = obj_utils.get_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('sasl'))
info = power._parse_driver_info(node)
@ -152,7 +159,7 @@ class LibvirtValidateParametersTestCase(db_base.DbTestCase):
def test__parse_driver_info_sasl_and_ssh_key(self):
node = obj_utils.get_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('ssh_sasl'))
self.assertRaises(exception.InvalidParameterValue,
@ -160,13 +167,13 @@ class LibvirtValidateParametersTestCase(db_base.DbTestCase):
node)
class LibvirtPrivateMethodsTestCase(db_base.DbTestCase):
class LibvirtPrivateMethodsTestCase(BaseLibvirtTest):
@mock.patch.object(power.libvirt, 'openAuth', autospec=True)
def test__get_libvirt_connection_sasl_auth(self, libvirt_open_mock):
node = obj_utils.get_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('sasl'))
power._get_libvirt_connection(node['driver_info'])
@ -181,7 +188,7 @@ class LibvirtPrivateMethodsTestCase(db_base.DbTestCase):
def test__get_libvirt_connection_ssh(self, libvirt_open_mock):
node = obj_utils.get_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('ssh_key'))
power._get_libvirt_connection(node['driver_info'])
@ -192,7 +199,7 @@ class LibvirtPrivateMethodsTestCase(db_base.DbTestCase):
def test__get_libvirt_connection_socket(self, libvirt_open_mock):
node = obj_utils.get_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('socket'))
power._get_libvirt_connection(node['driver_info'])
@ -204,7 +211,7 @@ class LibvirtPrivateMethodsTestCase(db_base.DbTestCase):
def test__get_libvirt_connection_error_conn(self, libvirt_open_mock):
node = obj_utils.get_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('socket'))
self.assertRaises(isd_exc.LibvirtError,
power._get_libvirt_connection,
@ -215,7 +222,7 @@ class LibvirtPrivateMethodsTestCase(db_base.DbTestCase):
def test__get_libvirt_connection_error_none_conn(self, libvirt_open_mock):
node = obj_utils.get_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('socket'))
self.assertRaises(isd_exc.LibvirtError,
power._get_libvirt_connection,
@ -224,11 +231,10 @@ class LibvirtPrivateMethodsTestCase(db_base.DbTestCase):
@mock.patch.object(power, '_get_libvirt_connection',
return_value=FakeConnection())
def test__get_domain_by_macs(self, libvirt_conn_mock):
self.config(enabled_drivers=["fake_libvirt_fake"])
driver_factory.get_driver("fake_libvirt_fake")
self.config(enabled_drivers=["staging-libvirt"])
node = obj_utils.create_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('socket'))
obj_utils.create_test_port(self.context,
node_id=node.id,
@ -243,11 +249,10 @@ class LibvirtPrivateMethodsTestCase(db_base.DbTestCase):
@mock.patch.object(power, '_get_libvirt_connection',
return_value=FakeConnection())
def test__get_domain_by_macs_not_found(self, libvirt_conn_mock):
self.config(enabled_drivers=["fake_libvirt_fake"])
driver_factory.get_driver("fake_libvirt_fake")
self.config(enabled_drivers=["staging-libvirt"])
node = obj_utils.create_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('socket'))
obj_utils.create_test_port(self.context,
node_id=node.id,
@ -427,15 +432,13 @@ class LibvirtPrivateMethodsTestCase(db_base.DbTestCase):
power._BOOT_DEVICES_MAP[boot_devices.DISK])
class LibvirtPowerTestCase(db_base.DbTestCase):
class LibvirtPowerTestCase(BaseLibvirtTest):
def setUp(self):
super(LibvirtPowerTestCase, self).setUp()
self.config(enabled_drivers=["fake_libvirt_fake"])
driver_factory.get_driver("fake_libvirt_fake")
self.node = obj_utils.create_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('sasl'))
obj_utils.create_test_port(self.context,
node_id=self.node.id,
@ -561,15 +564,13 @@ class LibvirtPowerTestCase(db_base.DbTestCase):
get_domain_mock.assert_called_once_with(task)
class LibvirtManagementTestCase(db_base.DbTestCase):
class LibvirtManagementTestCase(BaseLibvirtTest):
def setUp(self):
super(LibvirtManagementTestCase, self).setUp()
self.config(enabled_drivers=["fake_libvirt_fake"])
driver_factory.get_driver("fake_libvirt_fake")
self.node = obj_utils.create_test_node(
self.context,
driver='fake_libvirt_fake',
driver='staging-libvirt',
driver_info=_get_test_libvirt_driver_info('sasl'))
obj_utils.create_test_port(self.context,
node_id=self.node.id,

View File

@ -18,10 +18,10 @@
import socket
import time
from ironic.common import driver_factory
from ironic.common import exception as ironic_exception
from ironic.common import states
from ironic.conductor import task_manager
from ironic.drivers.modules import fake
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.objects import utils as obj_utils
import mock
@ -36,10 +36,10 @@ class WakeOnLanPrivateMethodTestCase(db_base.DbTestCase):
def setUp(self):
super(WakeOnLanPrivateMethodTestCase, self).setUp()
self.config(enabled_drivers=['fake_wol_fake'])
self.driver = driver_factory.get_driver('fake_wol_fake')
self.config(enabled_hardware_types=['staging-wol'],
enabled_power_interfaces=['fake', 'staging-wol'])
self.node = obj_utils.create_test_node(self.context,
driver='fake_wol_fake')
driver='staging-wol')
self.port = obj_utils.create_test_port(self.context,
node_id=self.node.id)
@ -63,7 +63,7 @@ class WakeOnLanPrivateMethodTestCase(db_base.DbTestCase):
node = obj_utils.create_test_node(
self.context,
uuid=uuidutils.generate_uuid(),
driver='fake_wol_fake')
driver='staging-wol')
with task_manager.acquire(
self.context, node.uuid, shared=True) as task:
self.assertRaises(ironic_exception.InvalidParameterValue,
@ -130,10 +130,10 @@ class WakeOnLanDriverTestCase(db_base.DbTestCase):
def setUp(self):
super(WakeOnLanDriverTestCase, self).setUp()
self.config(enabled_drivers=['fake_wol_fake'])
self.driver = driver_factory.get_driver('fake_wol_fake')
self.config(enabled_hardware_types=['staging-wol'],
enabled_power_interfaces=['fake', 'staging-wol'])
self.node = obj_utils.create_test_node(self.context,
driver='fake_wol_fake')
driver='staging-wol')
self.port = obj_utils.create_test_port(self.context,
node_id=self.node.id)
@ -141,6 +141,9 @@ class WakeOnLanDriverTestCase(db_base.DbTestCase):
expected = wol_power.COMMON_PROPERTIES
with task_manager.acquire(
self.context, self.node.uuid, shared=True) as task:
# Remove properties from the boot and deploy interfaces
task.driver.boot = fake.FakeBoot()
task.driver.deploy = fake.FakeDeploy()
self.assertEqual(expected, task.driver.get_properties())
def test_get_power_state(self):

View File

@ -13,67 +13,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from ironic.drivers import base
from ironic.drivers import generic
from ironic.drivers.modules import agent
from ironic.drivers.modules import fake
from ironic.drivers.modules import iscsi_deploy
from ironic.drivers.modules import pxe
from oslo_log import log as logging
from ironic_staging_drivers.wol import power as wol_power
LOG = logging.getLogger(__name__)
class FakeWakeOnLanFakeDriver(base.BaseDriver):
"""Fake Wake-On-Lan driver."""
def __init__(self):
self.boot = fake.FakeBoot()
self.power = wol_power.WakeOnLanPower()
self.deploy = fake.FakeDeploy()
class PXEWakeOnLanISCSIDriver(base.BaseDriver):
"""PXE + WakeOnLan + iSCSI driver.
This driver implements the `core` functionality, combining
:class:`ironic.drivers.modules.pxe.PXEBoot` for boot and
:class:`ironic_staging_drivers.wol.power.WakeOnLanPower` for power
and :class:`ironic.drivers.modules.iscsi_deploy.ISCSIDeploy` for
image deployment. Implementations are in those respective classes;
this class is merely the glue between them.
"""
def __init__(self):
LOG.warning("This driver is deprecated and will be removed "
"in the Rocky release. "
"Use 'staging-wol' hardware type instead.")
self.boot = pxe.PXEBoot()
self.power = wol_power.WakeOnLanPower()
self.deploy = iscsi_deploy.ISCSIDeploy()
class PXEWakeOnLanAgentDriver(base.BaseDriver):
"""PXE + WakeOnLan + Agent driver.
This driver implements the `core` functionality, combining
:class:`ironic.drivers.modules.pxe.PXEBoot` for boot and
:class:`ironic_staging_drivers.wol.power.WakeOnLanPower` for power
and :class:`ironic.drivers.modules.agent.AgentDeploy` for
image deployment. Implementations are in those respective classes;
this class is merely the glue between them.
"""
def __init__(self):
LOG.warning("This driver is deprecated and will be removed "
"in the Rocky release. "
"Use 'staging-wol' hardware type instead.")
self.boot = pxe.PXEBoot()
self.power = wol_power.WakeOnLanPower()
self.deploy = agent.AgentDeploy()
class WOLHardware(generic.GenericHardware):
"""WOL hardware type.

View File

@ -46,6 +46,7 @@
export DEVSTACK_GATE_IRONIC=1
export DEVSTACK_GATE_NEUTRON=1
export DEVSTACK_GATE_VIRT_DRIVER=ironic
export DEVSTACK_GATE_IRONIC_DRIVER=ipmi
export BRANCH_OVERRIDE=default
export PROJECTS="openstack/ironic $PROJECTS"
export PROJECTS="openstack/ironic-staging-drivers $PROJECTS"

View File

@ -0,0 +1,21 @@
---
upgrade:
- |
The following deprecated classic drivers have been removed:
* fake_wol_fake
* pxe_wol_iscsi
* pxe_wol_agent
* agent_ipmitool_nm
* fake_nm
* fake_amt_fake
* pxe_amt_iscsi
* pxe_amt_agent
* pxe_libvirt_agent
* pxe_libvirt_iscsi
* fake_libvirt_fake
* fake_iboot_fake
* pxe_iboot_iscsi
* pxe_iboot_agent
Use their hardware type counterparts instead.

View File

@ -23,22 +23,6 @@ packages =
ironic_staging_drivers
[entry_points]
ironic.drivers =
fake_wol_fake = ironic_staging_drivers.wol:FakeWakeOnLanFakeDriver
pxe_wol_iscsi = ironic_staging_drivers.wol:PXEWakeOnLanISCSIDriver
pxe_wol_agent = ironic_staging_drivers.wol:PXEWakeOnLanAgentDriver
agent_ipmitool_nm = ironic_staging_drivers.intel_nm:AgentAndIPMIToolIntelNMDriver
fake_nm = ironic_staging_drivers.intel_nm:FakeIntelNMDriver
fake_amt_fake = ironic_staging_drivers.amt.drivers:FakeAMTFakeDriver
pxe_amt_iscsi = ironic_staging_drivers.amt.drivers:PXEAndAMTISCSIDriver
pxe_amt_agent = ironic_staging_drivers.amt.drivers:PXEAndAMTAgentDriver
pxe_libvirt_agent = ironic_staging_drivers.libvirt:PXELibvirtAgentDriver
pxe_libvirt_iscsi = ironic_staging_drivers.libvirt:PXELibvirtISCSIDriver
fake_libvirt_fake = ironic_staging_drivers.libvirt:FakeLibvirtFakeDriver
fake_iboot_fake = ironic_staging_drivers.iboot:FakeIBootFakeDriver
pxe_iboot_iscsi = ironic_staging_drivers.iboot:PXEIBootISCSIDriver
pxe_iboot_agent = ironic_staging_drivers.iboot:PXEIBootAgentDriver
ironic.hardware.interfaces.deploy =
staging-amt = ironic_staging_drivers.amt.deploy:AMTISCSIDeploy