2016-09-30 00:55:32 +00:00
|
|
|
Index: cloud-init-0.7.8/cloudinit/distros/rhel.py
|
2015-02-20 02:14:45 +00:00
|
|
|
===================================================================
|
2016-09-30 00:55:32 +00:00
|
|
|
--- cloud-init-0.7.8.orig/cloudinit/distros/rhel.py
|
|
|
|
+++ cloud-init-0.7.8/cloudinit/distros/rhel.py
|
2015-02-20 02:14:45 +00:00
|
|
|
@@ -20,6 +20,8 @@
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
+import os.path
|
|
|
|
+
|
|
|
|
from cloudinit import distros
|
|
|
|
from cloudinit import helpers
|
|
|
|
from cloudinit import log as logging
|
2016-09-30 00:55:32 +00:00
|
|
|
@@ -201,13 +203,12 @@ class Distro(distros.Distro):
|
2015-02-20 02:14:45 +00:00
|
|
|
if pkgs is None:
|
|
|
|
pkgs = []
|
|
|
|
|
|
|
|
- cmd = ['yum']
|
|
|
|
- # If enabled, then yum will be tolerant of errors on the command line
|
|
|
|
- # with regard to packages.
|
|
|
|
- # For example: if you request to install foo, bar and baz and baz is
|
|
|
|
- # installed; yum won't error out complaining that baz is already
|
|
|
|
- # installed.
|
|
|
|
- cmd.append("-t")
|
|
|
|
+ if os.path.isfile('/usr/bin/dnf'):
|
|
|
|
+ LOG.debug('Using DNF for package management')
|
|
|
|
+ cmd = ['dnf']
|
|
|
|
+ else:
|
2016-09-30 00:55:32 +00:00
|
|
|
+ LOG.debug('Using YUM for package management')
|
2015-02-20 02:14:45 +00:00
|
|
|
+ cmd = ['yum', '-t']
|
|
|
|
# Determines whether or not yum prompts for confirmation
|
|
|
|
# of critical actions. We don't want to prompt...
|
|
|
|
cmd.append("-y")
|