Rely on ID/VERSION_ID to detect distro

REDHAT_SUPPORT_PRODUCT* are removed from recent
CentOS8.3 release[1], Let's use ID/VERSION_ID instead
which are available[2] and would serve our purpose.

[1] https://git.centos.org/rpms/centos-linux-release/c/2e3df0
[2] https://www.freedesktop.org/software/systemd/man/os-release.html

Change-Id: If14f4edad391fd9ee61851859ecdd3a51b97a215
This commit is contained in:
yatinkarel 2020-12-11 15:55:04 +05:30
parent 86a6821dd5
commit cb96526867
2 changed files with 6 additions and 6 deletions

View File

@ -14,7 +14,7 @@
# under the License.
source /etc/os-release
OS_NAME_VERS=${REDHAT_SUPPORT_PRODUCT}${REDHAT_SUPPORT_PRODUCT_VERSION}
OS_NAME_VERS=${ID}${VERSION_ID}
# Write out facts to the facter folder when we generate them.
export WRITE_FACTS=${WRITE_FACTS:-true}
@ -44,7 +44,7 @@ if [ -f /etc/ci/mirror_info.sh ]; then
fi
NODEPOOL_PUPPETLABS_MIRROR="http://${NODEPOOL_MIRROR_HOST}/apt-puppetlabs"
else
CEPH_MIRROR_HOST="${CENTOS_MIRROR_HOST}/centos/${REDHAT_SUPPORT_PRODUCT_VERSION}/storage/x86_64/ceph-${CEPH_VERSION}/"
CEPH_MIRROR_HOST="${CENTOS_MIRROR_HOST}/centos/${VERSION_ID}/storage/x86_64/ceph-${CEPH_VERSION}/"
NODEPOOL_PUPPETLABS_MIRROR="http://${NODEPOOL_MIRROR_HOST}/yum-puppetlabs"
fi
else
@ -56,7 +56,7 @@ else
CEPH_MIRROR_HOST="https://download.ceph.com/debian-${CEPH_VERSION}"
NODEPOOL_PUPPETLABS_MIRROR='https://apt.puppetlabs.com'
else
CEPH_MIRROR_HOST="${CENTOS_MIRROR_HOST}/centos/${REDHAT_SUPPORT_PRODUCT_VERSION}/storage/x86_64/ceph-${CEPH_VERSION}/"
CEPH_MIRROR_HOST="${CENTOS_MIRROR_HOST}/centos/${VERSION_ID}/storage/x86_64/ceph-${CEPH_VERSION}/"
NODEPOOL_PUPPETLABS_MIRROR="https://yum.puppetlabs.com"
fi
fi

View File

@ -192,8 +192,8 @@ install_puppet() {
$SUDO rpm --import files/GPG-KEY-puppet
$SUDO bash -c "cat << EOF > /etc/yum.repos.d/puppetlabs.repo
[puppetlabs-products]
name=Puppet Labs Products El ${REDHAT_SUPPORT_PRODUCT_VERSION} - x86_64
baseurl=${NODEPOOL_PUPPETLABS_MIRROR}/puppet${PUPPET_MAJ_VERSION}/el/${REDHAT_SUPPORT_PRODUCT_VERSION}/x86_64/
name=Puppet Labs Products El ${VERSION_ID} - x86_64
baseurl=${NODEPOOL_PUPPETLABS_MIRROR}/puppet${PUPPET_MAJ_VERSION}/el/${VERSION_ID}/x86_64/
gpgkey=file:///etc/pki/rpm-gpg/GPG-KEY-puppetlabs
file:///etc/pki/rpm-gpg/GPG-KEY-puppet
enabled=1
@ -227,7 +227,7 @@ function catch_selinux_alerts() {
# glance https://bugs.launchpad.net/glance/+bug/1769006
# nova https://bugs.launchpad.net/nova/+bug/1808975
# mistral https://bugs.launchpad.net/mistral/+bug/1808953
elif [ -f /etc/fedora-release ] || [[ "${REDHAT_SUPPORT_PRODUCT,,}" = "centos" && ${REDHAT_SUPPORT_PRODUCT_VERSION} = "8" ]]; then
elif [ -f /etc/fedora-release ] || [[ "${ID,,}" = "centos" && ${VERSION_ID} = "8" ]]; then
echo "non ssl scenario, ignoring it now."
else
echo "Please file a bug on https://bugzilla.redhat.com/enter_bug.cgi?product=Red%20Hat%20OpenStack&component=openstack-selinux showing sealert output."