Add the noop management interface to the manual-management hardware type

The current fake management interface fails when setting boot device to
disk, which makes manual-management unusable with boot_option:local.
As always with the noop management, we expect an operator to correctly
configure the boot order (e.g. to PXE with fall back to disk).

Change-Id: I551efa1a23dd3d6b33401610f298f436e8317539
This commit is contained in:
Dmitry Tantsur 2018-11-19 18:29:02 +01:00
parent 8bf0d866ae
commit 1aecb07b6f
3 changed files with 18 additions and 3 deletions

View File

@ -27,6 +27,7 @@ from ironic.drivers.modules.network import flat as flat_net
from ironic.drivers.modules.network import neutron
from ironic.drivers.modules.network import noop as noop_net
from ironic.drivers.modules import noop
from ironic.drivers.modules import noop_mgmt
from ironic.drivers.modules import pxe
from ironic.drivers.modules.storage import cinder
from ironic.drivers.modules.storage import external as external_storage
@ -96,7 +97,7 @@ class ManualManagementHardware(GenericHardware):
@property
def supported_management_interfaces(self):
"""List of supported management interfaces."""
return [fake.FakeManagement]
return [noop_mgmt.NoopManagement, fake.FakeManagement]
@property
def supported_power_interfaces(self):

View File

@ -23,6 +23,7 @@ from ironic.drivers.modules import fake
from ironic.drivers.modules import inspector
from ironic.drivers.modules import iscsi_deploy
from ironic.drivers.modules import noop
from ironic.drivers.modules import noop_mgmt
from ironic.drivers.modules import pxe
from ironic.tests.unit.db import base as db_base
from ironic.tests.unit.objects import utils as obj_utils
@ -34,14 +35,15 @@ class ManualManagementHardwareTestCase(db_base.DbTestCase):
super(ManualManagementHardwareTestCase, self).setUp()
self.config(enabled_hardware_types=['manual-management'],
enabled_power_interfaces=['fake'],
enabled_management_interfaces=['fake'])
enabled_management_interfaces=['noop', 'fake'])
self.config(enabled=True, group='inspector')
def test_default_interfaces(self):
node = obj_utils.create_test_node(self.context,
driver='manual-management')
with task_manager.acquire(self.context, node.id) as task:
self.assertIsInstance(task.driver.management, fake.FakeManagement)
self.assertIsInstance(task.driver.management,
noop_mgmt.NoopManagement)
self.assertIsInstance(task.driver.power, fake.FakePower)
self.assertIsInstance(task.driver.boot, pxe.PXEBoot)
self.assertIsInstance(task.driver.deploy, iscsi_deploy.ISCSIDeploy)
@ -53,6 +55,7 @@ class ManualManagementHardwareTestCase(db_base.DbTestCase):
enabled_raid_interfaces=['agent'])
node = obj_utils.create_test_node(self.context,
driver='manual-management',
management_interface='fake',
deploy_interface='direct',
raid_interface='agent')
with task_manager.acquire(self.context, node.id) as task:

View File

@ -0,0 +1,11 @@
---
deprecations:
- |
Using the ``fake`` management interface with the ``manual-management``
hardware type is deprecated, please use ``noop`` instead. Existing nodes
will have to be updated after the upgrade.
fixes:
- |
The ``manual-management`` hardware type now defaults to the ``noop``
management interface. Unlike the ``fake`` management interface, it does
not fail on attempt to set the boot device to the local disk.