for volume_type in volume_types: if 'volume_type' not in ctxt['enabled_backend_configs']: ctxt['enabled_backend_configs'][volume_type] = {} ctxt['enabled_backend_configs'][volume_type].update( {'cinder_catalog_info': volume_catalog_info})
And the bug is the string 'volume_type' rather than the bare volume_type in the "if 'volume_type' not in ...". It will always blank the ctxt[..][volume_type] as 'volume_type' (as a string key) doesn't exist in the ctxt[..] dictionary.
A relatively simple fix, but just waiting on Przemyslaw to do some live testing to see if the simple fix actually resolves the whole problem.
After some oob conversation with Przemyslaw, we worked out the bug is at:
https:/ /opendev. org/openstack/ charm-glance/ src/commit/ 3fadd2374f99bb7 d4e212cbe6cdb81 16d5eecfbd/ hooks/glance_ contexts. py#L389
Essentially, this code reads as:
for volume_type in volume_types:
if 'volume_type' not in ctxt['enabled_ backend_ configs' ]:
ctxt[ 'enabled_ backend_ configs' ][volume_ type] = {}
ctxt[ 'enabled_ backend_ configs' ][volume_ type].update(
{'cinder_ catalog_ info': volume_ catalog_ info})
And the bug is the string 'volume_type' rather than the bare volume_type in the "if 'volume_type' not in ...". It will always blank the ctxt[.. ][volume_ type] as 'volume_type' (as a string key) doesn't exist in the ctxt[..] dictionary.
A relatively simple fix, but just waiting on Przemyslaw to do some live testing to see if the simple fix actually resolves the whole problem.