Skip to content

Commit

Permalink
Add package logic for Amazon Linux 2
Browse files Browse the repository at this point in the history
This commit adds logic for Amazon Linux 2 to Beaker's install_ and
uninstall_package methods. (Note: AL2 is referred to in Vanagon and ABS
as Amazon Linux 7, in reference to the assumed compatibility with Red
Hat Enterprise Linux 7.)
  • Loading branch information
mhashizume committed May 20, 2024
1 parent 7053494 commit 1ba6d73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/beaker/host/unix/pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def install_package(name, cmdline_args = '', version = nil, opts = {})
when /amazon-2023|el-(8|9|1[0-9])|fedora/
name = "#{name}-#{version}" if version
execute("dnf -y #{cmdline_args} install #{name}", opts)
when /centos|redhat|el-[1-7]-/
when /amazon-7|centos|redhat|el-[1-7]-/
name = "#{name}-#{version}" if version
execute("yum -y #{cmdline_args} install #{name}", opts)
when /ubuntu|debian/
Expand Down Expand Up @@ -167,7 +167,7 @@ def uninstall_package(name, cmdline_args = '', opts = {})
execute("zypper --non-interactive rm #{name}", opts)
when /amazon-2023|el-(8|9|1[0-9])|fedora/
execute("dnf -y #{cmdline_args} remove #{name}", opts)
when /centos|redhat|el-[1-7]-/
when /amazon-7|centos|redhat|el-[1-7]-/
execute("yum -y #{cmdline_args} remove #{name}", opts)
when /ubuntu|debian/
execute("apt-get purge #{cmdline_args} -y #{name}", opts)
Expand Down

0 comments on commit 1ba6d73

Please sign in to comment.