From 71bd8b3a3397ba1f5452286e50f6ea73816c4582 Mon Sep 17 00:00:00 2001 From: Abel Lopez Date: Mon, 11 Jan 2016 12:03:45 -0800 Subject: [PATCH] Correct rhel-common for rhel6 Hardcoding subscription-manager to use rhel-7-server-rpms causes users building rhel6 with Satellite6 to fail. This setting cannot be overridden with environment variables, therefore needs to be smarter. Setting RHEL_MAJ_VER in the rhel/rhel7 environment fixes. Change-Id: Ifbd88bc76ef8b38a739272ba6e045a12849d68df Closes-Bug: 1404364 --- .../os-refresh-config/pre-configure.d/06-rhel-registration | 4 ++-- elements/rhel-common/pre-install.d/00-rhel-registration | 4 ++-- elements/rhel/environment.d/10-rhel-distro-name.bash | 1 + elements/rhel7/environment.d/10-rhel7-distro-name.bash | 1 + 4 files changed, 6 insertions(+), 4 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 21f386f2..a4d29b37 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 @@ -31,8 +31,8 @@ REG_METHOD="$(os-apply-config --key rh_registration.method --type raw --key-defa opts= attach_opts= -repos="repos --enable rhel-7-server-rpms" -satellite_repo="rhel-7-server-rh-common-rpms" +repos="repos --enable rhel-${RHEL_MAJ_VER}-server-rpms" +satellite_repo="rhel-${RHEL_MAJ_VER}-server-rh-common-rpms" if [ -n "${REG_AUTO_ATTACH:-}" ]; then opts="$opts --auto-attach" diff --git a/elements/rhel-common/pre-install.d/00-rhel-registration b/elements/rhel-common/pre-install.d/00-rhel-registration index dcb69d8f..3f0b8450 100755 --- a/elements/rhel-common/pre-install.d/00-rhel-registration +++ b/elements/rhel-common/pre-install.d/00-rhel-registration @@ -9,8 +9,8 @@ set -o pipefail opts= attach_opts= -repos="repos --enable rhel-7-server-rpms" -satellite_repo="rhel-7-server-rh-common-rpms" +repos="repos --enable rhel-${RHEL_MAJ_VER}-server-rpms" +satellite_repo="rhel-${RHEL_MAJ_VER}-server-rh-common-rpms" if [ -n "${REG_AUTO_ATTACH:-}" ]; then opts="$opts --auto-attach" diff --git a/elements/rhel/environment.d/10-rhel-distro-name.bash b/elements/rhel/environment.d/10-rhel-distro-name.bash index cf277400..9586e6ce 100644 --- a/elements/rhel/environment.d/10-rhel-distro-name.bash +++ b/elements/rhel/environment.d/10-rhel-distro-name.bash @@ -1 +1,2 @@ export DISTRO_NAME=rhel +export RHEL_MAJ_VER=6 diff --git a/elements/rhel7/environment.d/10-rhel7-distro-name.bash b/elements/rhel7/environment.d/10-rhel7-distro-name.bash index 07578d0e..c8eb6080 100644 --- a/elements/rhel7/environment.d/10-rhel7-distro-name.bash +++ b/elements/rhel7/environment.d/10-rhel7-distro-name.bash @@ -1 +1,2 @@ export DISTRO_NAME=rhel7 +export RHEL_MAJ_VER=7