Use external centos7-rt if present

Depending on the environment we execute this we need different
configuration for the centos7-rt repo, like at RDO zuul ci we have to
use nodepool mirrors, this patch check for a centos7-rt repo and enables
it if it's not present just creates a default one

Change-Id: I630a399d95752b1fb1e30220a582ace8d7b97f18
Related-Bug: #1814872
(cherry picked from commit d313a060c8)
This commit is contained in:
Quique Llorente 2019-02-12 10:38:37 +01:00
parent 1280d7f435
commit 5a6f6dbb8d
1 changed files with 7 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash -x
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
set -x
@ -7,6 +7,8 @@ set -eu
set -o pipefail
if [[ "$DISTRO_NAME" == *"centos"* ]]; then
current_rt_repo=$(yum repolist all|grep "centos7-rt" |awk '{print $1}'| head -n 1 || true)
if [[ "$current_rt_repo" == "" ]]; then
# tuned-profiles-cpu-partitioning is installed in rhel via fast-datapath.
# for centos, "rt" repo is added temprovarily (later change to centos
# nfv repo )
@ -18,4 +20,7 @@ enabled=1
gpgcheck=0
includepkgs=tuned-profiles-cpu-partitioning
EOF
fi
else
yum-config-manager --enable $current_rt_repo
fi
fi