diff --git a/elements/rhel-common/finalise.d/99-unregister b/elements/rhel-common/finalise.d/99-unregister index 7c56fc3f..fbf247f7 100755 --- a/elements/rhel-common/finalise.d/99-unregister +++ b/elements/rhel-common/finalise.d/99-unregister @@ -15,6 +15,12 @@ set -o pipefail # debugging purposes so you can check the portal or satellite to see what was # registered. Set REG_HALT_UNREGISTER to any non-null value to enable this # functionality. -if [ -z "${REG_HALT_UNREGISTER:-}" ]; then - subscription-manager unregister -fi +case "${REG_METHOD:-}" in + portal | satellite) + if [ -z "${REG_HALT_UNREGISTER:-}" ]; then + subscription-manager unregister + fi + ;; + disable) + ;; +esac diff --git a/elements/rhel-common/pre-install.d/00-rhel-registration b/elements/rhel-common/pre-install.d/00-rhel-registration index a5ed2d51..7b04a791 100755 --- a/elements/rhel-common/pre-install.d/00-rhel-registration +++ b/elements/rhel-common/pre-install.d/00-rhel-registration @@ -102,7 +102,6 @@ case "${REG_METHOD:-}" in ;; disable) echo "Disabling RHEL registration" - export REG_HALT_UNREGISTER=1 # stops attempt to unregister ;; *) echo "WARNING: only 'portal', 'satellite', and 'disable' are valid values for REG_METHOD."