lib/cloud_providers/ec2/ec2.rb in poolparty-1.3.13 vs lib/cloud_providers/ec2/ec2.rb in poolparty-1.3.14
- old
+ new
@@ -100,15 +100,16 @@
@ec2 ||= Rightscale::Ec2.new(access_key, secret_access_key, o.merge(:logger => PoolParty::PoolPartyLog, :endpoint_url => ec2_url))
end
# Start a new instance with the given options
def run_instance(o={})
+ number_of_instances = o[:number_of_instances] || 1
set_vars_from_options o
raise StandardError.new("You must pass a keypair to launch an instance, or else you will not be able to login. options = #{o.inspect}") if !keypair_name
response_array = ec2(o).run_instances(image_id,
min_count,
- max_count,
+ number_of_instances,
security_group,
keypair.basename,
user_data,
addressing_type,
instance_type,
@@ -121,10 +122,9 @@
Ec2Instance.new( Ec2Response.pp_format(aws_response_hash).merge(o) )
end
after_run_instance(instances)
- #FIXME: This needs to deal with the case when an array is returned if max_instances > 1
instances.first
end
# Will select the first instance matching the provided criteria hash
def describe_instance(hash_of_criteria_to_select_instance_against)
\ No newline at end of file