Class: Slugforge::Ec2InstanceGroup

Inherits:
HostGroup
  • Object
show all
Defined in:
lib/slugforge/models/host_group/ec2_instance_group.rb

Instance Attribute Summary

Attributes inherited from HostGroup

#hosts, #name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from HostGroup

detect, discover, #hosts_for_action, #install_all, #install_number_of_hosts, #install_percent_of_hosts, #sorted_hosts, #success?

Constructor Details

#initialize(pattern, compute) ⇒ Ec2InstanceGroup

Returns a new instance of Ec2InstanceGroup.



11
12
13
14
15
16
17
18
19
# File 'lib/slugforge/models/host_group/ec2_instance_group.rb', line 11

def initialize(pattern, compute)
  server = compute.servers.get(pattern)
  @hosts = if server.nil? || server.public_ip_address.nil?
             []
           else
             [ FogHost.new(pattern, server) ]
           end
  super
end

Class Method Details

.matcherObject



7
8
9
# File 'lib/slugforge/models/host_group/ec2_instance_group.rb', line 7

def self.matcher
  /^i-[0-9a-f]{8}$/i
end