Method: Beaker::Shared::HostManager#hosts_with_name
- Defined in:
- lib/beaker/shared/host_manager.rb
#hosts_with_name(hosts, name = nil) ⇒ Array<Host>
Find hosts from a given array of hosts that all have the desired name, match against host name, vmhostname and ip (the three valid ways to identify an individual host)
25 26 27 28 29 |
# File 'lib/beaker/shared/host_manager.rb', line 25 def hosts_with_name(hosts, name = nil) hosts.select do |host| name.nil? or host.name =~ /\A#{name}/ or host[:vmhostname] =~ /\A#{name}/ or host[:ip] =~ /\A#{name}/ end end |