get('osd_map') returns the cached object directly, so del and key
assignments were silently corrupting the cache for subsequent callers.
Take a shallow copy before modifying, and use pop() instead of del in
case the cache was already corrupted.
Fixes: https://tracker.ceph.com/issues/72447
Signed-off-by: Nitzan Mordechai <nmordec@ibm.com>
return mon_status
def osd_map(self):
- osd_map = mgr.get('osd_map')
+ osd_map = dict(mgr.get('osd_map'))
assert osd_map is not None
# Not needed, skip the effort of transmitting this to UI
- del osd_map['pg_temp']
+ osd_map.pop('pg_temp', None)
if self._minimal:
osd_map = partial_dict(osd_map, ['osds'])
osd_map['osds'] = [