From 6856d96f03ca7e5a796e5e266c745be28a8dda0b Mon Sep 17 00:00:00 2001 From: John Trowbridge Date: Tue, 19 May 2015 09:59:27 -0400 Subject: [PATCH] rhel-common element should not use attach with activation key In the case of using portal registration with an activation key, the rhel-common element is still executing a `subscription-manager attach` command. This should not happen if an activation key is provided. This is because an activation key already provides the subscriptions to attach. This patch fixes this behavior. Change-Id: I5a8425d1778362bb7a0dadc91a46308f16b2a526 Closes-Bug: #1456648 --- .../os-refresh-config/pre-configure.d/06-rhel-registration | 2 +- elements/rhel-common/pre-install.d/00-rhel-registration | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/elements/rhel-common/os-refresh-config/pre-configure.d/06-rhel-registration b/elements/rhel-common/os-refresh-config/pre-configure.d/06-rhel-registration index 79144eef..21f386f2 100755 --- a/elements/rhel-common/os-refresh-config/pre-configure.d/06-rhel-registration +++ b/elements/rhel-common/os-refresh-config/pre-configure.d/06-rhel-registration @@ -116,7 +116,7 @@ case "${REG_METHOD:-}" in portal) echo "Registering with options: $sanitized_opts" subscription-manager register $opts - if [ -z "${REG_AUTO_ATTACH:-}" ]; then + if [ -z "${REG_AUTO_ATTACH:-}" -a -z "${REG_ACTIVATION_KEY:-}" ]; then echo "Attaching with options: $attach_opts" subscription-manager attach $attach_opts fi diff --git a/elements/rhel-common/pre-install.d/00-rhel-registration b/elements/rhel-common/pre-install.d/00-rhel-registration index 4bfb1a24..dcb69d8f 100755 --- a/elements/rhel-common/pre-install.d/00-rhel-registration +++ b/elements/rhel-common/pre-install.d/00-rhel-registration @@ -93,7 +93,7 @@ case "${REG_METHOD:-}" in portal) echo "Registering with options: $sanitized_opts" subscription-manager register $opts - if [ -z "${REG_AUTO_ATTACH:-}" ]; then + if [ -z "${REG_AUTO_ATTACH:-}" -a -z "${REG_ACTIVATION_KEY:-}" ]; then echo "Attaching with options: $attach_opts" subscription-manager attach $attach_opts fi