Remove pass_deploy_info() from AMT driver
Change I0fc25c64339bc4c1f03ccb35cbc4efad4a7ad966 removes old ramdisk support from Ironic, and pass_deploy_info() method does not present. This patch removes pass_deploy_info() support from AMT driver. Change-Id: Iece3d18a55c94cb9406bac477d643321e8c6fc0a
This commit is contained in:
parent
d9f6198d90
commit
477fd760e3
|
@ -16,21 +16,12 @@ AMT Vendor Methods
|
|||
|
||||
from ironic.common import boot_devices
|
||||
from ironic.conductor import task_manager
|
||||
from ironic.drivers import base
|
||||
from ironic.drivers.modules import deploy_utils
|
||||
from ironic.drivers.modules import iscsi_deploy
|
||||
|
||||
|
||||
class AMTPXEVendorPassthru(iscsi_deploy.VendorPassthru):
|
||||
|
||||
@base.passthru(['POST'])
|
||||
@task_manager.require_exclusive_lock
|
||||
def pass_deploy_info(self, task, **kwargs):
|
||||
if deploy_utils.get_boot_option(task.node) == "netboot":
|
||||
task.driver.management.ensure_next_boot_device(task.node,
|
||||
boot_devices.PXE)
|
||||
super(AMTPXEVendorPassthru, self).pass_deploy_info(task, **kwargs)
|
||||
|
||||
@task_manager.require_exclusive_lock
|
||||
def continue_deploy(self, task, **kwargs):
|
||||
if deploy_utils.get_boot_option(task.node) == "netboot":
|
||||
|
|
|
@ -37,8 +37,7 @@ class AMTPXEVendorPassthruTestCase(db_base.DbTestCase):
|
|||
self.context, driver='pxe_amt_iscsi', driver_info=INFO_DICT)
|
||||
|
||||
def test_vendor_routes(self):
|
||||
expected = ['heartbeat', 'pass_deploy_info',
|
||||
'pass_bootloader_install_info']
|
||||
expected = ['heartbeat']
|
||||
with task_manager.acquire(self.context, self.node.uuid,
|
||||
shared=True) as task:
|
||||
vendor_routes = task.driver.vendor.vendor_routes
|
||||
|
@ -53,45 +52,6 @@ class AMTPXEVendorPassthruTestCase(db_base.DbTestCase):
|
|||
self.assertIsInstance(driver_routes, dict)
|
||||
self.assertEqual(sorted(expected), sorted(list(driver_routes)))
|
||||
|
||||
@mock.patch.object(amt_mgmt.AMTManagement, 'ensure_next_boot_device',
|
||||
spec_set=True, autospec=True)
|
||||
@mock.patch.object(iscsi_deploy.VendorPassthru, 'pass_deploy_info',
|
||||
spec_set=True, autospec=True)
|
||||
def test_vendorpassthru_pass_deploy_info_netboot(self,
|
||||
mock_pxe_vendorpassthru,
|
||||
mock_ensure):
|
||||
kwargs = {'address': '123456'}
|
||||
with task_manager.acquire(self.context, self.node.uuid,
|
||||
shared=False) as task:
|
||||
task.node.provision_state = states.DEPLOYWAIT
|
||||
task.node.target_provision_state = states.ACTIVE
|
||||
task.node.instance_info['capabilities'] = {
|
||||
"boot_option": "netboot"
|
||||
}
|
||||
task.driver.vendor.pass_deploy_info(task, **kwargs)
|
||||
mock_ensure.assert_called_with(
|
||||
task.driver.management, task.node, boot_devices.PXE)
|
||||
mock_pxe_vendorpassthru.assert_called_once_with(
|
||||
task.driver.vendor, task, **kwargs)
|
||||
|
||||
@mock.patch.object(amt_mgmt.AMTManagement, 'ensure_next_boot_device',
|
||||
spec_set=True, autospec=True)
|
||||
@mock.patch.object(iscsi_deploy.VendorPassthru, 'pass_deploy_info',
|
||||
spec_set=True, autospec=True)
|
||||
def test_vendorpassthru_pass_deploy_info_localboot(self,
|
||||
mock_pxe_vendorpassthru,
|
||||
mock_ensure):
|
||||
kwargs = {'address': '123456'}
|
||||
with task_manager.acquire(self.context, self.node.uuid,
|
||||
shared=False) as task:
|
||||
task.node.provision_state = states.DEPLOYWAIT
|
||||
task.node.target_provision_state = states.ACTIVE
|
||||
task.node.instance_info['capabilities'] = {"boot_option": "local"}
|
||||
task.driver.vendor.pass_deploy_info(task, **kwargs)
|
||||
self.assertFalse(mock_ensure.called)
|
||||
mock_pxe_vendorpassthru.assert_called_once_with(
|
||||
task.driver.vendor, task, **kwargs)
|
||||
|
||||
@mock.patch.object(amt_mgmt.AMTManagement, 'ensure_next_boot_device',
|
||||
spec_set=True, autospec=True)
|
||||
@mock.patch.object(iscsi_deploy.VendorPassthru, 'continue_deploy',
|
||||
|
|
Loading…
Reference in New Issue