From d6ccfb0e9ea0776c557d5d998178a0e0ff9e6f1b Mon Sep 17 00:00:00 2001 From: Shivanand Tendulker Date: Mon, 3 Apr 2017 05:11:12 -0400 Subject: [PATCH] Remove deprecated method build_instance_info_for_deploy() The method build_instance_info_for_deploy in ironic.drivers.modules.agent was deprecated in the Ocata cycle (7.0.0). It is no longer supported. The method build_instance_info_for_deploy() from ironic.drivers.modules.deploy_utils should be used instead. Change-Id: I88dfb0b84709ca3545bb4d4384bfad58ec2eb0a0 Closes-Bug: #1678902 --- ironic/drivers/modules/agent.py | 11 ----------- ironic/tests/unit/drivers/modules/test_agent.py | 11 ----------- ...ild-instance-info-for-deploy-2fe165fc018010e4.yaml | 8 ++++++++ 3 files changed, 8 insertions(+), 22 deletions(-) create mode 100644 releasenotes/notes/remove-deprecated-build-instance-info-for-deploy-2fe165fc018010e4.yaml diff --git a/ironic/drivers/modules/agent.py b/ironic/drivers/modules/agent.py index 1160066971..fb5f1c20c8 100644 --- a/ironic/drivers/modules/agent.py +++ b/ironic/drivers/modules/agent.py @@ -68,17 +68,6 @@ PARTITION_IMAGE_LABELS = ('kernel', 'ramdisk', 'root_gb', 'root_mb', 'swap_mb', 'deploy_boot_mode') -def build_instance_info_for_deploy(task): - # TODO(pas-ha) remove this in Pike cycle - LOG.warning(_LW("This function has moved to " - "'ironic.drivers.modules.deploy_utils' module. " - "Using it from 'ironic.drivers.modules.agent' module " - "is deprecated and will be removed in the Pike release. " - "Please update your driver to use this function " - "from its new location.")) - return deploy_utils.build_instance_info_for_deploy(task) - - @METRICS.timer('check_image_size') def check_image_size(task, image_source): """Check if the requested image is larger than the ram size. diff --git a/ironic/tests/unit/drivers/modules/test_agent.py b/ironic/tests/unit/drivers/modules/test_agent.py index b011ac9e91..cdbc0d1b8b 100644 --- a/ironic/tests/unit/drivers/modules/test_agent.py +++ b/ironic/tests/unit/drivers/modules/test_agent.py @@ -51,17 +51,6 @@ class TestAgentMethods(db_base.DbTestCase): driver='fake_agent') dhcp_factory.DHCPFactory._dhcp_provider = None - @mock.patch.object(agent.LOG, 'warning', autospec=True) - @mock.patch.object(deploy_utils, 'build_instance_info_for_deploy', - autospec=True) - def test_build_instance_info_for_deploy_warn(self, build_mock, warn_mock): - mgr_utils.mock_the_extension_manager(driver='fake_agent') - with task_manager.acquire( - self.context, self.node.uuid, shared=False) as task: - agent.build_instance_info_for_deploy(task) - build_mock.assert_called_once_with(task) - self.assertTrue(warn_mock.called) - @mock.patch.object(images, 'image_show', autospec=True) def test_check_image_size(self, show_mock): show_mock.return_value = { diff --git a/releasenotes/notes/remove-deprecated-build-instance-info-for-deploy-2fe165fc018010e4.yaml b/releasenotes/notes/remove-deprecated-build-instance-info-for-deploy-2fe165fc018010e4.yaml new file mode 100644 index 0000000000..3493ecb1ba --- /dev/null +++ b/releasenotes/notes/remove-deprecated-build-instance-info-for-deploy-2fe165fc018010e4.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + The method build_instance_info_for_deploy() from + ironic.drivers.modules.agent was deprecated in Ocata cycle (7.0.0). + It is no longer supported. Please use the method + build_instance_info_for_deploy() from ironic.drivers.modules.deploy_utils + instead.