Skip to content

Commit

Permalink
Default to DNF for Fedora
Browse files Browse the repository at this point in the history
Prior to this commit, the install and uninstall methods for Fedora
defaulted to using DNF as its package manager for versions greater than
or equal to 22 but less than 40, and Yum for every other version.

This commit configures Beaker to use DNF for every version of Fedora, as
DNF has been the default package manager for Fedora for the last 8
years.
  • Loading branch information
mhashizume committed Nov 22, 2023
1 parent 38d3879 commit 0a635ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/beaker/host/unix/pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ def install_package(name, cmdline_args = '', version = nil, opts = {})
execute("zypper --non-interactive --gpg-auto-import-keys in #{name}", opts)
when /el-4/
@logger.debug("Package installation not supported on rhel4")
when /amazon-2023|el-(8|9|1[0-9])|fedora-(2[2-9]|3[0-9])/
when /amazon-2023|el-(8|9|1[0-9])|fedora/
name = "#{name}-#{version}" if version
execute("dnf -y #{cmdline_args} install #{name}", opts)
when /cisco|fedora|centos|redhat|eos|el-[1-7]-/
when /cisco|centos|redhat|eos|el-[1-7]-/
name = "#{name}-#{version}" if version
execute("yum -y #{cmdline_args} install #{name}", opts)
when /ubuntu|debian|cumulus|huaweios/
Expand Down Expand Up @@ -172,9 +172,9 @@ def uninstall_package(name, cmdline_args = '', opts = {})
execute("zypper --non-interactive rm #{name}", opts)
when /el-4/
@logger.debug("Package uninstallation not supported on rhel4")
when /amazon-2023|el-(8|9|1[0-9])|fedora-(2[2-9]|3[0-9])/
when /amazon-2023|el-(8|9|1[0-9])|fedora/
execute("dnf -y #{cmdline_args} remove #{name}", opts)
when /cisco|fedora|centos|redhat|eos|el-[1-7]-/
when /cisco|centos|redhat|eos|el-[1-7]-/
execute("yum -y #{cmdline_args} remove #{name}", opts)
when /ubuntu|debian|cumulus|huaweios/
execute("apt-get purge #{cmdline_args} -y #{name}", opts)
Expand Down

0 comments on commit 0a635ea

Please sign in to comment.