in which cond logic is added to ssh.rb

This commit is contained in:
Eric Putnam 2016-09-30 13:24:58 -07:00
parent 86e1792775
commit 01e95ce31e

View file

@ -21,7 +21,12 @@ class Ssh
os_types = {}
os_types[host_os] = 1
if host_os =~ /.*\..*/
cmd = "#{ssh_path} root@#{host_os}"
Kernel.exec(cmd)
else
response = Pooler.retrieve(verbose, os_types, token, url)
if response["ok"] == true
if host_os =~ /win/
user = "Administrator"
@ -30,6 +35,7 @@ class Ssh
end
hostname = "#{response[host_os]["hostname"]}.#{response["domain"]}"
cmd = "#{ssh_path} #{user}@#{hostname}"
# TODO: Should this respect more ssh settings? Can it be configured
@ -38,6 +44,7 @@ class Ssh
else
raise "Could not get vm from vmpooler:\n #{response}"
end
end
return
end
end