Method: Beaker::Shared::HostManager#hosts_with_role
- Defined in:
- lib/beaker/shared/host_manager.rb
#hosts_with_role(hosts, desired_role = nil) ⇒ Array<Host>
Find hosts from a given array of hosts that all have the desired role.
14 15 16 17 18 |
# File 'lib/beaker/shared/host_manager.rb', line 14 def hosts_with_role(hosts, desired_role = nil) hosts.select do |host| desired_role.nil? or host['roles'].include?(desired_role.to_s) end end |