20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/commands/common/thor/node.rb', line 20
def get_node_info_for_ssh_login(node_id, context_params)
context_params.forward_options(:json_return => true)
response = info_aux(context_params)
return response unless response.ok?
unless node_info = response.data(:nodes).find{ |node| node_id == (node['node_properties'] || {})['node_id'] }
raise DtkError, "Cannot find info about node with id '#{node_id}'"
end
data = {}
node_properties = node_info['node_properties'] || {}
if public_dns = node_properties['ec2_public_address']
data.merge!('public_dns' => public_dns)
end
if default_login_user = NodeMixin.default_login_user?(node_properties)
data.merge!('default_login_user' => default_login_user)
end
Response::Ok.new(data)
end
|