lib/cloud_providers/ec2/ec2.rb in poolparty-1.4.5 vs lib/cloud_providers/ec2/ec2.rb in poolparty-1.4.6
- old
+ new
@@ -160,19 +160,29 @@
:image_id => image_id,
:min_count => num,
:max_count => num,
:key_name => keypair.basename,
:security_groups => security_groups,
- :user_data => user_data,
+ :user_data => decoded_user_data,
:instance_type => instance_type,
:availability_zone => availability_zones.first,
:base64_encoded => true,
:cloud => cloud
})
progress_bar_until("Waiting for node to launch...") do
wait_for_node(e)
end
all_nodes.detect {|n| n.instance_id == e.instance_id }
+ end
+
+ def decoded_user_data
+ if user_data
+ if File.file?(user_data)
+ open(user_data).read
+ else
+ user_data
+ end
+ end
end
def wait_for_node(instance)
reset!
inst = all_nodes.detect {|n| n.instance_id == instance.instance_id }
\ No newline at end of file