copr-builder: don't give up RHSM unregistering

This way we have less work in the periodic cron job
(see cleanup-unused-redhat-subscriptions script).
This commit is contained in:
Pavel Raiskup 2022-03-10 19:23:38 +01:00
parent d731413fc5
commit 8b7f2dda0b

View file

@ -6,7 +6,12 @@ test -z "$RESALLOC_NAME" && die "no vm specified, empty \$RESALLOC_NAME variable
# Try to, best effort, remove the entitlement.
set -- $(echo "$RESALLOC_RESOURCE_DATA" | base64 --decode)
ssh root@"$1" "subscription-manager unregister" || :
# Don't give-up unregistering after the first attempt
for _ in a b c; do
ssh root@"$1" "subscription-manager unregister" && break
sleep 5
done
case "$RESALLOC_POOL_ID" in
*aws*)