Class: Bcome::Ssh::Driver
Constant Summary
Bcome::Ssh::DriverConnection::DEFAULT_TIMEOUT_IN_SECONDS
Instance Attribute Summary collapse
#connection
Instance Method Summary
collapse
#local_port_forward_command, #rsync_command, #ssh_command
Methods included from DriverUser
#fallback_bastion_host_user, #fallback_local_user, #get_overriden_local_user, #overriden_local_user, #user
#do_ssh, #get, #local_port_forward, #ping, #put, #put_str, #rsync, #scp
#close_ssh_connection, #has_open_ssh_con?, #net_ssh_params, #node_host_or_ip, #proxy, #ssh_connect!, #ssh_connection, #timeout_in_seconds
Constructor Details
#initialize(config, context_node) ⇒ Driver
14
15
16
17
|
# File 'lib/objects/ssh/driver.rb', line 14
def initialize(config, context_node)
@config = config
@context_node = context_node
end
|
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
7
8
9
|
# File 'lib/objects/ssh/driver.rb', line 7
def config
@config
end
|
#context_node ⇒ Object
Returns the value of attribute context_node.
7
8
9
|
# File 'lib/objects/ssh/driver.rb', line 7
def context_node
@context_node
end
|
Instance Method Details
#connection_wrangler ⇒ Object
19
20
21
|
# File 'lib/objects/ssh/driver.rb', line 19
def connection_wrangler
@connection_wrangler ||= set_connection_wrangler
end
|
#has_multi_hop_proxy? ⇒ Boolean
54
55
56
|
# File 'lib/objects/ssh/driver.rb', line 54
def has_multi_hop_proxy?
!multi_hop_proxy_config.nil?
end
|
#has_proxy? ⇒ Boolean
58
59
60
|
# File 'lib/objects/ssh/driver.rb', line 58
def has_proxy?
return connection_wrangler.has_hop?
end
|
#multi_hop_proxy_config ⇒ Object
50
51
52
|
# File 'lib/objects/ssh/driver.rb', line 50
def multi_hop_proxy_config
@config[:multi_hop_proxy]
end
|
#pretty_ssh_config ⇒ Object
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
# File 'lib/objects/ssh/driver.rb', line 31
def pretty_ssh_config
config = {
user: user,
timeout: timeout_in_seconds
}
if has_proxy?
config[:proxy] = connection_wrangler.proxy_details
else
config[:host_or_ip] = node_host_or_ip
end
config
end
|
#proxy_chain ⇒ Object
23
24
25
|
# File 'lib/objects/ssh/driver.rb', line 23
def proxy_chain
@proxy_chain ||= ::Bcome::Ssh::ProxyChain.new(connection_wrangler)
end
|
#proxy_config_value ⇒ Object
46
47
48
|
# File 'lib/objects/ssh/driver.rb', line 46
def proxy_config_value
@config[:proxy]
end
|
#set_connection_wrangler ⇒ Object
27
28
29
|
# File 'lib/objects/ssh/driver.rb', line 27
def set_connection_wrangler
@connection_wrangler = ::Bcome::Ssh::ConnectionWrangler.new(self)
end
|