From a21585c9e4481887444bda628586c0afac55f413 Mon Sep 17 00:00:00 2001 From: OpenStack Proposal Bot Date: Thu, 3 Aug 2017 15:26:12 +0000 Subject: [PATCH] Updated from OpenStack Ansible Tests Change-Id: Ia9c13c909d9de1012434ba242792a05614c619d4 --- run_tests.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index 969e3db0..e8f6f3ac 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -35,9 +35,12 @@ source /etc/os-release || source /usr/lib/os-release install_pkg_deps() { pkg_deps="git" + # Prefer dnf over yum for CentOS. + which dnf &>/dev/null && RHT_PKG_MGR='dnf' || RHT_PKG_MGR='yum' + case ${ID,,} in *suse*) pkg_mgr_cmd="zypper -n in" ;; - centos|rhel) pkg_mgr_cmd="yum install -y" ;; + centos|rhel) pkg_mgr_cmd="${RHT_PKG_MGR} install -y" ;; fedora) pkg_mgr_cmd="dnf -y install" ;; ubuntu|debian) pkg_mgr_cmd="apt-get install -y" ;; *) echo "unsupported distribution: ${ID,,}"; exit 1 ;;