bin/pool-start in poolparty-0.2.18 vs bin/pool-start in poolparty-0.2.69
- old
+ new
@@ -1,31 +1,25 @@
#!/usr/bin/env ruby
$:.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
require "poolparty"
require "poolpartycl"
+
o = PoolParty::Optioner.new(ARGV) do |opts, optioner|
opts.on('-p poolname', '--pool name', 'Start pool by this name') { |p| optioner.poolname p }
end
-load_pool(o.spec || Binary.get_existing_spec_location)
-
-@testing = o.testing
-
-include Remote
-
-@pools = o.poolname ? [pool(o.poolname.downcase.to_sym)] : pools
-
-@pools.each do |name, pl|
+o.loaded_pools.each do |pl|
- with_pool(pl, {:testing => @testing}) do
+ with_pool(pl) do
+ puts subheader("Pool: #{pl.name}")
- puts header("Starting pool")
- clouds.each do |name, cloud|
- puts subheader("Cloud: #{name}")
- puts "#{cloud.list_of_running_instances.size} running instances (#{cloud.minimum_instances} - #{cloud.maximum_instances})"
- if (cloud.minimum_instances - cloud.list_of_running_instances.size) > 0
- puts "Starting #{cloud.minimum_instances - cloud.list_of_running_instances.size} instances (from #{cloud.keypair})"
- testing ? puts("\tNot launching while in testing mode") : cloud.launch_minimum_number_of_instances
+ pool_clouds.each do |cl|
+ vputs subheader("Cloud: #{cl.name}")
+
+ cl.launch_and_configure_master!
+ when_no_pending_instances do
+ puts open(::File.join(File.dirname(__FILE__), "..", "lib", "poolparty", "config", "postlaunchmessage.txt")).read ^ {:master_ip => cl.master.ip.chomp}
+ clear_base_directory unless testing
end
end
end
end
\ No newline at end of file