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] c0ce6ebf19/ironic/drivers/modules/deploy_utils.py (L1263),L1268

Change-Id: I9ff3c55cff035b0ff87b36da820f8129a9ffcbe2
Partial-bug: #1559691
(cherry picked from commit e6f09618a5)
This commit is contained in:
Hironori Shiina 2017-08-21 15:15:34 +09:00 committed by Ruby Loo
parent 5638890840
commit 9305aedf83
2 changed files with 5 additions and 3 deletions

View File

@ -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.

View File

@ -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',