Parse live data with correct key 'readonly'
Cinder returns the volume infos with key 'readonly', not 'read_only', so parse live data with correct key 'readonly' for volume resource. Change-Id: If19db3129f23a6cb9d19e6744c4ffc4522166426 Closes-Bug: #1712041
This commit is contained in:
parent
87208f3d02
commit
72be5266ee
@ -676,8 +676,8 @@ class CinderVolume(vb.BaseVolume, sh.SchedulerHintsMixin):
|
|||||||
|
|
||||||
if (resource_data.get(self.METADATA) and
|
if (resource_data.get(self.METADATA) and
|
||||||
resource_data.get(self.METADATA).get(
|
resource_data.get(self.METADATA).get(
|
||||||
self.READ_ONLY) is not None):
|
'readonly') is not None):
|
||||||
read_only = resource_data.get(self.METADATA).pop(self.READ_ONLY)
|
read_only = resource_data.get(self.METADATA).pop('readonly')
|
||||||
volume_reality.update({self.READ_ONLY: read_only})
|
volume_reality.update({self.READ_ONLY: read_only})
|
||||||
|
|
||||||
old_vt = self.data().get(self.VOLUME_TYPE)
|
old_vt = self.data().get(self.VOLUME_TYPE)
|
||||||
|
@ -1318,7 +1318,7 @@ class CinderVolumeTest(vt_base.BaseVolumeTest):
|
|||||||
'availability_zone': 'nova',
|
'availability_zone': 'nova',
|
||||||
'snapshot_id': None,
|
'snapshot_id': None,
|
||||||
'size': 1,
|
'size': 1,
|
||||||
'metadata': {'test': 'test_value', 'read_only': False},
|
'metadata': {'test': 'test_value', 'readonly': False},
|
||||||
'consistencygroup_id': '4444',
|
'consistencygroup_id': '4444',
|
||||||
'volume_image_metadata': {'image_id': '1234',
|
'volume_image_metadata': {'image_id': '1234',
|
||||||
'image_name': 'test'},
|
'image_name': 'test'},
|
||||||
|
Loading…
Reference in New Issue
Block a user