From: Jos Collin Date: Tue, 24 Feb 2026 12:17:10 +0000 (+0530) Subject: fixed snapshot_mirror.py X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d4b5bde498da2d94d63e4cbe36b94ae2765c73eb;p=ceph-ci.git fixed snapshot_mirror.py Signed-off-by: Jos Collin --- diff --git a/src/pybind/mgr/mirroring/fs/snapshot_mirror.py b/src/pybind/mgr/mirroring/fs/snapshot_mirror.py index 3d4f88a6e0e..86d4ed46eba 100644 --- a/src/pybind/mgr/mirroring/fs/snapshot_mirror.py +++ b/src/pybind/mgr/mirroring/fs/snapshot_mirror.py @@ -182,8 +182,8 @@ class FSPolicy: sync_latest_snapshot = False sync_from_snapshot = None if lookup_info: - sync_latest_snapshot = lookup_info['sync_latest_snapshot'] - sync_from_snapshot = lookup_info['sync_from_snapshot'] + sync_latest_snapshot = lookup_info['sync_latest_snapshot'] if 'sync_latest_snapshot' in lookup_info else False + sync_from_snapshot = lookup_info['sync_from_snapshot'] if 'sync_from_snapshot' in lookup_info else None return json.dumps({'dir_path': dir_path, 'mode': 'acquire', 'sync_latest_snapshot': sync_latest_snapshot, @@ -208,11 +208,12 @@ class FSPolicy: continue elif action_type == ActionType.MAP_UPDATE: # take care to not overwrite purge status - update_map[dir_path] = {'version': 1, - 'instance_id': lookup_info['instance_id'], - 'last_shuffled': lookup_info['mapped_time'], - 'sync_latest_snapshot': lookup_info['sync_latest_snapshot'], - 'sync_from_snapshot': lookup_info['sync_from_snapshot'] + update_map[dir_path] = { + 'version': 1, + 'instance_id': lookup_info['instance_id'], + 'last_shuffled': lookup_info['mapped_time'], + 'sync_latest_snapshot': lookup_info['sync_latest_snapshot'] if 'sync_latest_snapshot' in lookup_info else False, + 'sync_from_snapshot': lookup_info['sync_from_snapshot'] if 'sync_from_snapshot' in lookup_info else None } if lookup_info['purging']: update_map[dir_path]['purging'] = 1