From e6f09618a58f9af8671d0ba6bda6f3ee92a90efa Mon Sep 17 00:00:00 2001 From: Hironori Shiina Date: Mon, 21 Aug 2017 15:15:34 +0900 Subject: [PATCH] Fix names of capabilities for FibreChannel volume boot Cinder uses 'fibre_channel' to for the volume type for FibreChannel volumes. This value is returned as 'driver_volume_type' when initialize_connection API. Then, nova sets the value to a volume target of ironic. The capabilities names of interfaces to allow FC boot are expected to use the value in populating[1]. This patch fixes the capabilities names from 'fc' to 'fibre_channel'. [1] https://github.com/openstack/ironic/blob/c0ce6ebf1988c29cc68d16fc2e9142a022f7024b/ironic/drivers/modules/deploy_utils.py#L1263,L1268 Change-Id: I9ff3c55cff035b0ff87b36da820f8129a9ffcbe2 Partial-bug: #1559691 --- ironic/drivers/modules/irmc/boot.py | 2 +- ironic/tests/unit/drivers/modules/test_deploy_utils.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ironic/drivers/modules/irmc/boot.py b/ironic/drivers/modules/irmc/boot.py index 62303d9db4..32a8fdc6c0 100644 --- a/ironic/drivers/modules/irmc/boot.py +++ b/ironic/drivers/modules/irmc/boot.py @@ -864,7 +864,7 @@ class IRMCVolumeBootMixIn(object): class IRMCVirtualMediaBoot(base.BootInterface, IRMCVolumeBootMixIn): """iRMC Virtual Media boot-related actions.""" - capabilities = ['iscsi_volume_boot', 'fc_volume_boot'] + capabilities = ['iscsi_volume_boot', 'fibre_channel_volume_boot'] def __init__(self): """Constructor of IRMCVirtualMediaBoot. diff --git a/ironic/tests/unit/drivers/modules/test_deploy_utils.py b/ironic/tests/unit/drivers/modules/test_deploy_utils.py index 68930eae79..a8e8d05dd0 100644 --- a/ironic/tests/unit/drivers/modules/test_deploy_utils.py +++ b/ironic/tests/unit/drivers/modules/test_deploy_utils.py @@ -2489,8 +2489,10 @@ class TestStorageInterfaceUtils(db_base.DbTestCase): @mock.patch.object(fake, 'FakeDeploy', autospec=True) def test_populate_storage_driver_internal_info_error( self, mock_deploy, mock_boot): - mock_deploy.return_value = mock.Mock(capabilities=['fc_volume_deploy']) - mock_boot.return_value = mock.Mock(capabilities=['fc_volume_boot']) + mock_deploy.return_value = mock.Mock( + capabilities=['fibre_channel_volume_deploy']) + mock_boot.return_value = mock.Mock( + capabilities=['fibre_channel_volume_boot']) obj_utils.create_test_volume_target( self.context, node_id=self.node.id, volume_type='iscsi',