summaryrefslogtreecommitdiff
path: root/ironic/drivers/drac.py
diff options
context:
space:
mode:
authorDmitry Tantsur <divius.inside@gmail.com>2018-01-31 16:40:23 +0100
committerDmitry Tantsur <divius.inside@gmail.com>2018-02-01 18:38:24 +0100
commitd1062cfbdd3fdacc4e4bd807f1508f90557bef65 (patch)
tree7e08abbf98f5df255116f714a1a5b2377f0143c3 /ironic/drivers/drac.py
parent8f464b909a1a6fa2ec5b62fee0fd83e1bcd240da (diff)
downloadironic-d1062cfbdd3fdacc4e4bd807f1508f90557bef65.tar.gz
Migrate the remaining classic drivers to hardware types
I've tried my best to provide a correct matching for these, but there are two exceptions: * fake_drac uses iscsi deploy with None boot, which cannot work, so changing both to fake * some fake drivers are migrated to the 'fake' power interface, which is changed to include soft power as well. The latter means that all fake classic drivers now support fake soft power actions, while previously only fake_soft_power did. Now fake_soft_power is identical to fake and is left for backward compatibility Also wrote more tests to check correctness of this migration. Change-Id: I00c9c6ed698b10f035e65428e1a20d733c7e544a Partial-Bug: #1690185
Diffstat (limited to 'ironic/drivers/drac.py')
-rw-r--r--ironic/drivers/drac.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/ironic/drivers/drac.py b/ironic/drivers/drac.py
index 7fedaee27..2b44c1e5f 100644
--- a/ironic/drivers/drac.py
+++ b/ironic/drivers/drac.py
@@ -15,6 +15,7 @@
DRAC Driver for remote system management using Dell Remote Access Card.
"""
+from oslo_config import cfg
from oslo_utils import importutils
from ironic.common import exception
@@ -32,6 +33,9 @@ from ironic.drivers.modules import noop
from ironic.drivers.modules import pxe
+CONF = cfg.CONF
+
+
class IDRACHardware(generic.GenericHardware):
"""integrated Dell Remote Access Controller hardware type"""
@@ -85,6 +89,16 @@ class PXEDracDriver(base.BaseDriver):
self.vendor = vendor_passthru.DracVendorPassthru()
self.inspect = drac_inspect.DracInspect()
+ @classmethod
+ def to_hardware_type(cls):
+ return 'idrac', {'boot': 'pxe',
+ 'deploy': 'iscsi',
+ 'inspect': 'idrac',
+ 'management': 'idrac',
+ 'power': 'idrac',
+ 'raid': 'idrac',
+ 'vendor': 'idrac'}
+
class PXEDracInspectorDriver(PXEDracDriver):
"""Drac driver using PXE for deploy and OOB inspection interface."""
@@ -93,3 +107,20 @@ class PXEDracInspectorDriver(PXEDracDriver):
super(PXEDracInspectorDriver, self).__init__()
self.inspect = inspector.Inspector.create_if_enabled(
'PXEDracInspectorDriver')
+
+ @classmethod
+ def to_hardware_type(cls):
+ # NOTE(dtantsur): classic drivers are not affected by the
+ # enabled_inspect_interfaces configuration option.
+ if CONF.inspector.enabled:
+ inspect_interface = 'inspector'
+ else:
+ inspect_interface = 'no-inspect'
+
+ return 'idrac', {'boot': 'pxe',
+ 'deploy': 'iscsi',
+ 'inspect': inspect_interface,
+ 'management': 'idrac',
+ 'power': 'idrac',
+ 'raid': 'idrac',
+ 'vendor': 'idrac'}