Merge "Add missing agent RAID compatibility for ilo5 and idrac" into stable/ussuri

This commit is contained in:
Zuul 2020-07-19 16:41:29 +00:00 committed by Gerrit Code Review
commit bcf2993dce
5 changed files with 38 additions and 25 deletions

View File

@ -25,7 +25,6 @@ from ironic.drivers.modules.drac import management
from ironic.drivers.modules.drac import power from ironic.drivers.modules.drac import power
from ironic.drivers.modules.drac import raid from ironic.drivers.modules.drac import raid
from ironic.drivers.modules.drac import vendor_passthru from ironic.drivers.modules.drac import vendor_passthru
from ironic.drivers.modules import inspector
from ironic.drivers.modules import ipxe from ironic.drivers.modules import ipxe
from ironic.drivers.modules import noop from ironic.drivers.modules import noop
from ironic.drivers.modules import pxe from ironic.drivers.modules import pxe
@ -69,13 +68,14 @@ class IDRACHardware(generic.GenericHardware):
# if it is enabled by an operator (implying that the service is # if it is enabled by an operator (implying that the service is
# installed). # installed).
return [drac_inspect.DracWSManInspect, drac_inspect.DracInspect, return [drac_inspect.DracWSManInspect, drac_inspect.DracInspect,
drac_inspect.DracRedfishInspect, inspector.Inspector, drac_inspect.DracRedfishInspect] + super(
noop.NoInspect] IDRACHardware, self).supported_inspect_interfaces
@property @property
def supported_raid_interfaces(self): def supported_raid_interfaces(self):
"""List of supported raid interfaces.""" """List of supported raid interfaces."""
return [raid.DracWSManRAID, raid.DracRAID, noop.NoRAID] return [raid.DracWSManRAID, raid.DracRAID] + super(
IDRACHardware, self).supported_raid_interfaces
@property @property
def supported_vendor_interfaces(self): def supported_vendor_interfaces(self):

View File

@ -24,7 +24,6 @@ from ironic.drivers.modules.ilo import management
from ironic.drivers.modules.ilo import power from ironic.drivers.modules.ilo import power
from ironic.drivers.modules.ilo import raid from ironic.drivers.modules.ilo import raid
from ironic.drivers.modules.ilo import vendor from ironic.drivers.modules.ilo import vendor
from ironic.drivers.modules import inspector
from ironic.drivers.modules import noop from ironic.drivers.modules import noop
@ -53,8 +52,8 @@ class IloHardware(generic.GenericHardware):
@property @property
def supported_inspect_interfaces(self): def supported_inspect_interfaces(self):
"""List of supported inspect interfaces.""" """List of supported inspect interfaces."""
return [inspect.IloInspect, inspector.Inspector, return [inspect.IloInspect] + super(
noop.NoInspect] IloHardware, self).supported_inspect_interfaces
@property @property
def supported_management_interfaces(self): def supported_management_interfaces(self):
@ -81,7 +80,8 @@ class Ilo5Hardware(IloHardware):
@property @property
def supported_raid_interfaces(self): def supported_raid_interfaces(self):
"""List of supported raid interfaces.""" """List of supported raid interfaces."""
return [raid.Ilo5RAID, noop.NoRAID] return [raid.Ilo5RAID] + super(
Ilo5Hardware, self).supported_raid_interfaces
@property @property
def supported_management_interfaces(self): def supported_management_interfaces(self):

View File

@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from oslo_utils import uuidutils
from ironic.conductor import task_manager from ironic.conductor import task_manager
from ironic.drivers.modules import agent from ironic.drivers.modules import agent
from ironic.drivers.modules import drac from ironic.drivers.modules import drac
@ -42,7 +44,7 @@ class IDRACHardwareTestCase(db_base.DbTestCase):
'no-inspect'], 'no-inspect'],
enabled_network_interfaces=['flat', 'neutron', 'noop'], enabled_network_interfaces=['flat', 'neutron', 'noop'],
enabled_raid_interfaces=[ enabled_raid_interfaces=[
'idrac', 'idrac-wsman', 'no-raid'], 'idrac', 'idrac-wsman', 'no-raid', 'agent'],
enabled_vendor_interfaces=[ enabled_vendor_interfaces=[
'idrac', 'idrac-wsman', 'no-vendor'], 'idrac', 'idrac-wsman', 'no-vendor'],
enabled_bios_interfaces=[ enabled_bios_interfaces=[
@ -108,11 +110,14 @@ class IDRACHardwareTestCase(db_base.DbTestCase):
inspect=inspector.Inspector) inspect=inspector.Inspector)
def test_override_with_raid(self): def test_override_with_raid(self):
node = obj_utils.create_test_node(self.context, driver='idrac', for iface, impl in [('agent', agent.AgentRAID),
raid_interface='no-raid') ('no-raid', noop.NoRAID)]:
with task_manager.acquire(self.context, node.id) as task: node = obj_utils.create_test_node(self.context,
self._validate_interfaces(task.driver, uuid=uuidutils.generate_uuid(),
raid=noop.NoRAID) driver='idrac',
raid_interface=iface)
with task_manager.acquire(self.context, node.id) as task:
self._validate_interfaces(task.driver, raid=impl)
def test_override_no_vendor(self): def test_override_no_vendor(self):
node = obj_utils.create_test_node(self.context, driver='idrac', node = obj_utils.create_test_node(self.context, driver='idrac',

View File

@ -16,10 +16,11 @@
Test class for iLO Drivers Test class for iLO Drivers
""" """
from oslo_utils import uuidutils
from ironic.conductor import task_manager from ironic.conductor import task_manager
from ironic.drivers import ilo from ironic.drivers import ilo
from ironic.drivers.modules import agent from ironic.drivers.modules import agent
from ironic.drivers.modules.ilo import management
from ironic.drivers.modules.ilo import raid from ironic.drivers.modules.ilo import raid
from ironic.drivers.modules import inspector from ironic.drivers.modules import inspector
from ironic.drivers.modules import iscsi_deploy from ironic.drivers.modules import iscsi_deploy
@ -187,16 +188,6 @@ class Ilo5HardwareTestCase(db_base.DbTestCase):
def test_default_interfaces(self): def test_default_interfaces(self):
node = obj_utils.create_test_node(self.context, driver='ilo5') node = obj_utils.create_test_node(self.context, driver='ilo5')
with task_manager.acquire(self.context, node.id) as task: with task_manager.acquire(self.context, node.id) as task:
self.assertIsInstance(task.driver.raid, raid.Ilo5RAID)
self.assertIsInstance(task.driver.management,
management.Ilo5Management)
def test_override_with_no_raid(self):
self.config(enabled_raid_interfaces=['no-raid', 'ilo5'])
node = obj_utils.create_test_node(self.context, driver='ilo5',
raid_interface='no-raid')
with task_manager.acquire(self.context, node.id) as task:
self.assertIsInstance(task.driver.raid, noop.NoRAID)
self.assertIsInstance(task.driver.boot, self.assertIsInstance(task.driver.boot,
ilo.boot.IloVirtualMediaBoot) ilo.boot.IloVirtualMediaBoot)
self.assertIsInstance(task.driver.console, self.assertIsInstance(task.driver.console,
@ -209,7 +200,19 @@ class Ilo5HardwareTestCase(db_base.DbTestCase):
ilo.management.IloManagement) ilo.management.IloManagement)
self.assertIsInstance(task.driver.power, self.assertIsInstance(task.driver.power,
ilo.power.IloPower) ilo.power.IloPower)
self.assertIsInstance(task.driver.raid, raid.Ilo5RAID)
self.assertIsInstance(task.driver.rescue, self.assertIsInstance(task.driver.rescue,
noop.NoRescue) noop.NoRescue)
self.assertIsInstance(task.driver.vendor, self.assertIsInstance(task.driver.vendor,
ilo.vendor.VendorPassthru) ilo.vendor.VendorPassthru)
def test_override_raid(self):
self.config(enabled_raid_interfaces=['agent', 'no-raid', 'ilo5'])
for iface, impl in [('agent', agent.AgentRAID),
('no-raid', noop.NoRAID)]:
node = obj_utils.create_test_node(self.context,
uuid=uuidutils.generate_uuid(),
driver='ilo5',
raid_interface=iface)
with task_manager.acquire(self.context, node.id) as task:
self.assertIsInstance(task.driver.raid, impl)

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixes missing ``agent`` RAID compatibility for the ``ilo5`` and ``idrac``
hardware type preventing software RAID for working with them.