vmc/lib/cli/console_helper.rb in vmc-0.4.0.beta.30 vs vmc/lib/cli/console_helper.rb in vmc-0.4.0.beta.31
- old
+ new
@@ -30,13 +30,24 @@
conn_info = {'hostname' => entry[:console_ip], 'port' => entry[:console_port]}
end
def start_local_console(port, appname)
auth_info = console_credentials(appname)
- display "Connecting to '#{appname}' console: ", false
+ banner = "Connecting to '#{appname}' console: "
+ display banner, false
+ t = Thread.new do
+ count = 0
+ while count < 90 do
+ display '.', false
+ sleep 1
+ count += 1
+ end
+ end
prompt = console_login(auth_info, port)
- display "OK".green
+ Thread.kill(t)
+ clear(80)
+ display "#{banner}#{'OK'.green}"
display "\n"
initialize_readline
run_console prompt
end
@@ -45,11 +56,11 @@
err "Unable to verify console credentials."
end
@telnet_client = telnet_client(port)
prompt = nil
err_msg = "Login attempt timed out."
- 5.times do
+ 3.times do
begin
results = @telnet_client.login("Name"=>auth_info["username"],
"Password"=>auth_info["password"])
lines = results.sub("Login: Password: ", "").split("\n")
last_line = lines.pop
@@ -65,10 +76,9 @@
#This may happen if we login right after app starts
close_console
sleep 5
@telnet_client = telnet_client(port)
end
- display ".", false
end
unless prompt
close_console
err err_msg
end