← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] lp:~harlowja/cloud-init/cloud-init-fix-dnf into lp:cloud-init

 


Diff comments:

> === modified file 'cloudinit/distros/rhel.py'
> --- cloudinit/distros/rhel.py	2016-06-15 23:11:24 +0000
> +++ cloudinit/distros/rhel.py	2016-07-01 00:07:56 +0000
> @@ -201,14 +203,22 @@
>          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")
> -        # Determines whether or not yum prompts for confirmation
> +        if (os.path.isfile('/usr/bin/dnf') or

Util.which?

> +                self._cfg.get('force_dnf', False)):
> +            LOG.debug('Using DNF for package management')
> +            cmd = ['dnf']
> +        else:

Is there a case where you do not want to use dnf even though it is installed?  If you prefer yum?

> +            LOG.debug('Using YUM for package management')
> +            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")
> +
> +        # Determines whether or not yum/dnf prompts for confirmation
>          # of critical actions. We don't want to prompt...
>          cmd.append("-y")
>  


-- 
https://code.launchpad.net/~harlowja/cloud-init/cloud-init-fix-dnf/+merge/298851
Your team cloud init development team is requested to review the proposed merge of lp:~harlowja/cloud-init/cloud-init-fix-dnf into lp:cloud-init.


References