From c4763ac5969874da6c7be39320477d702fecd5d6 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Wed, 9 Oct 2024 01:14:19 -0400 Subject: [PATCH] Fix invalid responses during promote --- daemon-common/vm.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/daemon-common/vm.py b/daemon-common/vm.py index c3159dc3..fded43c6 100644 --- a/daemon-common/vm.py +++ b/daemon-common/vm.py @@ -4587,11 +4587,14 @@ def vm_worker_promote_mirror( vm_detail = get_list(zkhandler, limit=dom_uuid, is_fuzzy=False)[1][0] # Determine if there's a valid shared snapshot to send an incremental diff from - local_snapshots = {s["name"] for s in vm_detail["snapshots"]} - remote_snapshots = {s["name"] for s in destination_vm_detail["snapshots"]} - incremental_parent = next( - (s for s in local_snapshots if s in remote_snapshots), None - ) + if destination_vm_detail: + local_snapshots = {s["name"] for s in vm_detail["snapshots"]} + remote_snapshots = {s["name"] for s in destination_vm_detail["snapshots"]} + incremental_parent = next( + (s for s in local_snapshots if s in remote_snapshots), None + ) + else: + incremental_parent = None current_stage += 1 update(