Skip to content

Commit 5edeb4f

Browse files
cheng-zgaborigloi
authored andcommitted
CA-228029: Fix update destroy failure in xe-install-supplemental-pack when exception happens
The problem here is that for code like trap "xe update-pool-clean uuid=$update_uuid" EXIT ERR trap "xe update-destroy uuid=$update_uuid" ERR In testing, it will call xe update-destroy first. After xe update-destroy, xe update-pool-clean will have no object to refer. We expect the code will call pool_clean first then destroy. But what we wrote in trap seems cannot make sure this sequence Signed-off-by: Cheng Zhang <[email protected]>
1 parent 3ec9a64 commit 5edeb4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/xe-install-supplemental-pack

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ iso="$1"
3232
[ -n "$iso" ] || usage
3333

3434
update_uuid=$(xe update-upload file-name="$iso" ${sr_uuid:+sr-uuid=$sr_uuid})
35-
trap "xe update-pool-clean uuid=$update_uuid" EXIT ERR
36-
trap "xe update-destroy uuid=$update_uuid" ERR
35+
trap "set +e; xe update-pool-clean uuid=$update_uuid; xe update-destroy uuid=$update_uuid; set -e" ERR
3736
xe update-apply uuid=$update_uuid host=$INSTALLATION_UUID
37+
xe update-pool-clean uuid=$update_uuid

0 commit comments

Comments
 (0)