Permalink
Browse files

added 'open_terminal' method to allow a terminal to be opened for a s…

…ingle named instance; fixed a type in validate_servers
  • Loading branch information...
1 parent e4a9254 commit eeb5de97a6440727e0c4b171e18aed475cb53638 @mattinasi mattinasi committed Jul 20, 2011
Showing with 14 additions and 2 deletions.
  1. +14 −2 lcaws.rb
View
@@ -186,6 +186,18 @@ def open_web_terminals(ecc, instances, args)
end
end
+def open_terminal(ecc, instances, args)
+ name = args[1]
+ instances.each do |s|
+ puts s.name
+ if s.name == name && s.state == "running"
+ cmd = "ssh -i intuit-baseline.pem ea@#{s.dns_name}"
+ puts "opening terminal for #{s.name}: #{cmd}"
+ `scripts/it #{cmd}`
+ end
+ end
+end
+
def show_dbs(ecc, instances, args)
puts "Current Database Instances:"
dbs = ecc.get_rds_instances
@@ -223,7 +235,7 @@ def validate_servers(ecc, instances, args)
#connect cia ssh and rub hostname on validate connection
public_ping = system "ssh #{public_name} hostname > /dev/null 2>&1"
- puts "Private Ping Failed for #{current_server.name}" if !public_ping
+ puts "Public Ping Failed for #{current_server.name}" if !public_ping
#gather the data!!
status << [private_name, public_name, private_ping, public_ping]
rescue
@@ -243,7 +255,7 @@ def print_usage
" start_apps, stop_apps, show_apps, open_app_terminals, \n" +
" start_loadgens, stop_loadgens, open_loadgen_termials, \n"+
" start_webs, stop_webs, show_webs, open_web_terminals\n"+
- " show_dbs, list_instances"
+ " show_dbs, list_instances, validate_servers"
end
###############

0 comments on commit eeb5de9

Please sign in to comment.