Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DNF for Fedora, newer Enterprise Linux #1835

Merged
merged 2 commits into from
Nov 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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|fedora-(2[2-9]|3[0-9])/
when /amazon-2023|el-(8|9|1[0-9])|fedora-(2[2-9]|3[0-9])/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fedora 40 is about to come out. Any thoughts on assuming DNF?

    when /cisco|eos|el-[1-7]-/
      # yum
    when /amazon|el|fedora/
      # dnf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. I guess at this point,we can assume any Fedora < 22 machines running are long gone.

I'll add another commit

name = "#{name}-#{version}" if version
execute("dnf -y #{cmdline_args} install #{name}", opts)
when /cisco|fedora|centos|redhat|eos|el-/
when /cisco|fedora|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|fedora-(2[2-9]|3[0-9])/
when /amazon-2023|el-(8|9|1[0-9])|fedora-(2[2-9]|3[0-9])/
execute("dnf -y #{cmdline_args} remove #{name}", opts)
when /cisco|fedora|centos|redhat|eos|el-/
when /cisco|fedora|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