From e620e45790659356f35b60724d625b27d7c750c6 Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Wed, 14 Oct 2020 20:17:51 +0100 Subject: [PATCH] CinderFixture: Return a driver_type of `fake` within connection_info Previously the attachment info returned by the fixture would incorrectly list the driver_type outside of the connection_info dict [1][2]. This changes moves it within the connection_info dict and updates the type to `fake` for use by the libvirt driver that provides a compatible volume driver [3] for use in our functional tests. [1] https://docs.openstack.org/api-ref/block-storage/v3/index.html?expanded=create-attachment-detail#id407 [2] https://docs.openstack.org/api-ref/block-storage/v3/index.html?expanded=update-an-attachment-detail#id411 [3] https://github.com/openstack/nova/blob/2c3ff1004e8812da0bc4e5502762e6b9a7650846/nova/virt/libvirt/volume/volume.py#L171-L184 Change-Id: I73ff0a7508d9f8f6f3d498be13f6f7c505b05e5c --- nova/tests/fixtures.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/nova/tests/fixtures.py b/nova/tests/fixtures.py index 11b5f7bd3f..471bc77acf 100644 --- a/nova/tests/fixtures.py +++ b/nova/tests/fixtures.py @@ -2575,11 +2575,16 @@ class CinderFixture(fixtures.Fixture): _attachment['connector'].get('host'))) attachment['connector'] = connector LOG.info('Updating volume attachment: %s', attachment_id) - attachment_ref = {'driver_volume_type': 'fake_type', - 'id': attachment_id, - 'connection_info': {'data': - {'foo': 'bar', - 'target_lun': '1'}}} + attachment_ref = { + 'id': attachment_id, + 'connection_info': { + 'driver_volume_type': 'fake', + 'data': { + 'foo': 'bar', + 'target_lun': '1' + } + } + } if attachment_id == self.SWAP_ERR_ATTACH_ID: # This intentionally triggers a TypeError for the # instance.volume_swap.error versioned notification tests.