Merge lp:~harlowja/cloud-init/cloud-init-fix-dnf into lp:~cloud-init-dev/cloud-init/trunk

Proposed by Joshua Harlow
Status: Merged
Merge reported by: Scott Moser
Merged at revision: not available
Proposed branch: lp:~harlowja/cloud-init/cloud-init-fix-dnf
Merge into: lp:~cloud-init-dev/cloud-init/trunk
Diff against target: 33 lines (+16/-8)
1 file modified
cloudinit/distros/rhel.py (+16/-8)
To merge this branch: bzr merge lp:~harlowja/cloud-init/cloud-init-fix-dnf
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
cloud-init Commiters Pending
Review via email: mp+298851@code.launchpad.net

Description of the change

Enable usage of DNF for package management

DNF is the new YUM replacement so if it exists
or if its usage is forced try to use it instead
to install packages.

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) :
Revision history for this message
Joshua Harlow (harlowja) :
1249. By Joshua Harlow

Use util.which and always use dnf if it is around

1250. By Joshua Harlow

The os import is no longer needed

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

Hello,
Thank you for taking the time to contribute to cloud-init. Cloud-init has moved its revision control system to git. As a result, we are marking all bzr merge proposals as 'rejected'. If you would like to re-submit this proposal for review, please do so by following the current HACKING documentation at http://cloudinit.readthedocs.io/en/latest/topics/hacking.html .

I think this is actually already merged at
https://git.launchpad.net/cloud-init/commit/?id=a3daf184fd4

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'cloudinit/distros/rhel.py'
--- cloudinit/distros/rhel.py 2016-06-15 23:11:24 +0000
+++ cloudinit/distros/rhel.py 2016-07-13 00:25:38 +0000
@@ -201,14 +201,22 @@
201 if pkgs is None:201 if pkgs is None:
202 pkgs = []202 pkgs = []
203203
204 cmd = ['yum']204 dnf_bin = util.which("dnf")
205 # If enabled, then yum will be tolerant of errors on the command line205 if dnf_bin:
206 # with regard to packages.206 LOG.debug('Using DNF for package management')
207 # For example: if you request to install foo, bar and baz and baz is207 cmd = [dnf_bin]
208 # installed; yum won't error out complaining that baz is already208 else:
209 # installed.209 LOG.debug('Using YUM for package management')
210 cmd.append("-t")210 cmd = ['yum']
211 # Determines whether or not yum prompts for confirmation211 # If enabled, then yum will be tolerant of errors on the command
212 # line with regard to packages.
213 #
214 # For example: if you request to install foo, bar and baz and
215 # baz is installed; yum won't error out complaining that baz
216 # is already installed.
217 cmd.append("-t")
218
219 # Determines whether or not yum/dnf prompts for confirmation
212 # of critical actions. We don't want to prompt...220 # of critical actions. We don't want to prompt...
213 cmd.append("-y")221 cmd.append("-y")
214222