Method: Beaker::HostPrebuiltSteps#install_one_of_packages

Defined in:
lib/beaker/host_prebuilt_steps.rb

#install_one_of_packages(host, packages) ⇒ Object

Installs one of alternative packages (first available)

Parameters:

  • host (Host)

    Host to act on

  • packages (Array<String>)

    List of package names (alternatives).



112
113
114
115
116
117
118
119
120
121
122
# File 'lib/beaker/host_prebuilt_steps.rb', line 112

def install_one_of_packages host, packages
  error = nil
  packages.each do |pkg|
    begin
      return host.install_package pkg
    rescue Beaker::Host::CommandFailure => e
      error = e
    end
  end
  raise error
end