From 60c2a46d3ee6fd15309b16f090ab239a5ce1ae7d Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Tue, 28 Jun 2022 11:39:19 +0200 Subject: [PATCH] Fix flapping storage_protocol in get-pools After "fixing" the storage_protocol reported by get_pools, in Change-Id I07d74078dbb102490dd722029e32c74cec3aa44c, there are cases where the storage_protocol reported by the get_pools REST API call may change from the canonical name (eg NFS) to the value being reported by the driver (nfs). This happens because the original patch missed the fact that the capabilities dict is still being used in some cases even after the BackendState instance has been created and updated, so it's not enough to update the BackendState values but we also need to update the dict itself. Related-Bug: #1966103 Change-Id: I6621901ad1ac2b96fd5b6ebb0c6efb6b2eeb188e --- cinder/scheduler/host_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cinder/scheduler/host_manager.py b/cinder/scheduler/host_manager.py index f8c47705686..6d340dd241e 100644 --- a/cinder/scheduler/host_manager.py +++ b/cinder/scheduler/host_manager.py @@ -330,6 +330,8 @@ class BackendState(object): # Protocols that have variants are replaced with ALL the variants protocol = capability.get('storage_protocol', None) self.storage_protocol = self.get_storage_protocol_variants(protocol) + if 'storage_protocol' in capability: + capability['storage_protocol'] = self.storage_protocol self.updated = capability['timestamp'] def consume_from_volume(self,