Browse code

Merge "Switch to dnf when it exists"

Zuul authored on 2018/06/22 00:17:11
Showing 1 changed files
... ...
@@ -814,11 +814,14 @@ SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT=${SERVICE_GRACEFUL_SHUTDOWN_TIMEOUT:-5}
814 814
 # Service graceful shutdown timeout
815 815
 WORKER_TIMEOUT=${WORKER_TIMEOUT:-90}
816 816
 
817
-# Support alternative yum -- in future Fedora 'dnf' will become the
818
-# only supported installer, but for now 'yum' and 'dnf' are both
819
-# available in parallel with compatible CLIs.  Allow manual switching
820
-# till we get to the point we need to handle this automatically
821
-YUM=${YUM:-yum}
817
+# Choose DNF on RedHat/Fedora platforms with it, or otherwise default
818
+# to YUM.  Can remove this when only dnf is supported (i.e. centos7
819
+# disappears)
820
+if [[ -e /usr/bin/dnf ]]; then
821
+    YUM=${YUM:-dnf}
822
+else
823
+    YUM=${YUM:-yum}
824
+fi
822 825
 
823 826
 # Common Configuration
824 827
 # --------------------