Class: Net::SSH::Xlogin::Connection
- Inherits:
-
Telnet
- Object
- Telnet
- Net::SSH::Xlogin::Connection
- Defined in:
- lib/net/ssh/xlogin/connection.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(template, name, **opts) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(template, name, **opts) ⇒ Connection
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/net/ssh/xlogin/connection.rb', line 11 def initialize(template, name, **opts) @name = name = opts log = [:log] || [:output_log] max_retry = [:max_retry] || 1 [:timeout] ||= template.timeout [:host_name] ||= name begin args = Hash.new args["Output_log"] = log if log args["Dump_log"] = [:dump_log] if [:dump_log] args["Prompt"] = [:prompt] || template.prompt_patten args["Timeout"] = [:timeout] || 10 args["Waittime"] = [:waittime] || 0 args["Terminator"] = [:terminator] || LF args["Binmode"] = [:binmode] || false args["PTYOptions"] = [:ptyoptions] || {} if [:relay] relay = [:relay] info = Factory.instance.inventory[relay] [:port] = Net::SSH::Gateway.new(relay, nil , info) end if [:proxy] args["Host"] = [:host_name] args["Port"] = [:port] args["Username"] = [:user] args["Password"] = [:password] args["Proxy"] = [:proxy] else = .slice(*Net::SSH::VALID_OPTIONS) = [:host] unless [:host_name] args['Session'] = Net::SSH.start(name, nil, ) end super(args) rescue => e retry if (max_retry -= 1) > 0 raise e end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
9 10 11 |
# File 'lib/net/ssh/xlogin/connection.rb', line 9 def name @name end |