diff options
author | Scott Moser <smoser@brickies.net> | 2017-03-03 02:26:38 -0500 |
---|---|---|
committer | Scott Moser <smoser@brickies.net> | 2017-03-03 02:26:38 -0500 |
commit | d7004bcf269fe60e456de336ecda9a9d2fe50bfd (patch) | |
tree | cf49b1fbc06388d46fa435814d24d97c83476047 /cloudinit/distros/rhel.py | |
parent | 1de8720effd029727bb5ef7972e7e4d859a1b53a (diff) | |
parent | c81ea53bbdc4ada9d2b52430e106aeb3c38b4e0a (diff) | |
download | vyos-cloud-init-d7004bcf269fe60e456de336ecda9a9d2fe50bfd.tar.gz vyos-cloud-init-d7004bcf269fe60e456de336ecda9a9d2fe50bfd.zip |
merge from master at 0.7.9-47-gc81ea53
Diffstat (limited to 'cloudinit/distros/rhel.py')
-rw-r--r-- | cloudinit/distros/rhel.py | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py index aa558381..7498c63a 100644 --- a/cloudinit/distros/rhel.py +++ b/cloudinit/distros/rhel.py @@ -190,13 +190,18 @@ class Distro(distros.Distro): 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 util.which('dnf'): + LOG.debug('Using DNF for package management') + cmd = ['dnf'] + else: + LOG.debug('Using YUM for package management') + # the '-t' argument makes yum 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 = ['yum', '-t'] # Determines whether or not yum prompts for confirmation # of critical actions. We don't want to prompt... cmd.append("-y") |