Class: LASRpcUtils::AbstractTransport
- Inherits:
-
Object
- Object
- LASRpcUtils::AbstractTransport
- Includes:
- MintLogger
- Defined in:
- src/las-rpc-utils/lib/las-rpc-utils/abstract-transport.rb
Direct Known Subclasses
Properties (Read/Write)
Properties (Read Only)
Constant Summary collapse
- SCRIPT_READY =
TransportSearchString.new("---limepoint-ready---")
- SCRIPT_FAIL =
TransportSearchString.new("---limepoint-fail---")
- SCRIPT_RESULT =
TransportSearchString.new("---limepoint-result---")
- SCRIPT_START =
TransportSearchString.new("---limepoint-script-start---")
- SCRIPT_END =
TransportSearchString.new("---limepoint-script-end---")
- PROMPT_PREAMBLE =
TransportSearchString.new("---limepoint-preamble---")
- REBOOTED =
TransportSearchString.new("REBOOTED")
- OKAY =
TransportSearchString.new("OKAY")
Constants included from MintLogger
MintLogger::DEBUG, MintLogger::ERROR, MintLogger::FATAL, MintLogger::INFO, MintLogger::UNKNOWN, MintLogger::VERBOSE, MintLogger::WARN
Instance Attribute Summary collapse
-
#channel_mutex ⇒ Object
Transport options for SSH: sudo_user - use sudo sudo_password - password for sudo, if required sudo_shell_type - "su" or "direct" - direct is default, which will run sudo -i port - default 22.
-
#direct ⇒ Object
Returns the value of attribute direct.
-
#dontkillme ⇒ Object
Returns the value of attribute dontkillme.
-
#eof ⇒ Object
Returns the value of attribute eof.
Instance Method Summary collapse
-
#alive?(fast: false) ⇒ Boolean
test if the connection is alive! This should not tkae wall clock time, but does....
- #allocate ⇒ Object
- #allocated? ⇒ Boolean
- #buffer_length ⇒ Object
- #debug? ⇒ Boolean
-
#disable_history ⇒ Object
Children must implement: directrm(remote) directput(remote, content) directfile(remote) process_buffers send_text(text, newline: true) hop(host, type, transport_options).
- #execute(command, environment: {}, loglevel: 'info', fast: false) ⇒ Object
- #in_use? ⇒ Boolean
- #info? ⇒ Boolean
-
#initialize(host, transport_options, parent_transport, channel_id: nil) ⇒ AbstractTransport
constructor
A new instance of AbstractTransport.
- #logconsole(partial: false, filter: [], split_filter: true, level: 'info', error_loglevel: nil, log_until: -1,, error_only: false) ⇒ Object
- #platform ⇒ Object
- #release ⇒ Object
- #reserve ⇒ Object
- #reserved? ⇒ Boolean
- #set_default_init(init) ⇒ Object
- #set_parent(parent) ⇒ Object
- #start_channel(transport_options, recon: false, actually_in_use: false) ⇒ Object
- #start_execute(command, environment: {}, loglevel: 'info', fast: false, retry_count: 0) ⇒ Object
- #unallocate ⇒ Object
- #uuid ⇒ Object
- #wait_for_complete(loglevel: 'info', timeout: nil) ⇒ Object
- #wait_for_prompt ⇒ Object
- #wait_for_stdout(wtext, type: 'normal', failtext: nil, timeout: -1,, trim_working: false, local_echo: true, filter: ['---limepoint-'], loglevel: 'info', error_loglevel: nil, show_wait: false) ⇒ Object
- #wait_for_stream_start(timeout = 300) ⇒ Object
-
#wait_respond(wait_success:, wait_fail: nil, sendback:, timeout: WAIT_TIMEOUT, sensitive: false) ⇒ Object
wait_respond: Waits for the success or failure strings.
Methods included from MintLogger::Utils::Common
#boolean_val, #has_value?, #no_value?, #nvl, #path_as_symbol, #ruby_level_to_send
Constructor Details
#initialize(host, transport_options, parent_transport, channel_id: nil) ⇒ AbstractTransport
Returns a new instance of AbstractTransport.
Instance Attribute Details
#channel_mutex ⇒ Object
Transport options for SSH:
sudo_user - use sudo
sudo_password - password for sudo, if required
sudo_shell_type - "su" or "direct" - direct is default, which will run sudo -i
port - default 22
#direct ⇒ Object
Returns the value of attribute direct.
#dontkillme ⇒ Object
Returns the value of attribute dontkillme.
#eof ⇒ Object
Returns the value of attribute eof.
Instance Method Details
#alive?(fast: false) ⇒ Boolean
test if the connection is alive!
This should not tkae wall clock time, but does....
This shou;d be fixed!
#allocate ⇒ Object
#allocated? ⇒ Boolean
#buffer_length ⇒ Object
#debug? ⇒ Boolean
#disable_history ⇒ Object
Children must implement:
directrm(remote)
directput(remote, content)
directfile(remote)
process_buffers
send_text(text, newline: true)
hop(host, type, transport_options)
#execute(command, environment: {}, loglevel: 'info', fast: false) ⇒ Object
#in_use? ⇒ Boolean
#info? ⇒ Boolean
#logconsole(partial: false, filter: [], split_filter: true, level: 'info', error_loglevel: nil, log_until: -1,, error_only: false) ⇒ Object
#platform ⇒ Object
#release ⇒ Object
#reserve ⇒ Object
#reserved? ⇒ Boolean
#set_default_init(init) ⇒ Object
#set_parent(parent) ⇒ Object
#start_channel(transport_options, recon: false, actually_in_use: false) ⇒ Object
#start_execute(command, environment: {}, loglevel: 'info', fast: false, retry_count: 0) ⇒ Object
#unallocate ⇒ Object
#uuid ⇒ Object
#wait_for_complete(loglevel: 'info', timeout: nil) ⇒ Object
#wait_for_prompt ⇒ Object
#wait_for_stdout(wtext, type: 'normal', failtext: nil, timeout: -1,, trim_working: false, local_echo: true, filter: ['---limepoint-'], loglevel: 'info', error_loglevel: nil, show_wait: false) ⇒ Object
#wait_for_stream_start(timeout = 300) ⇒ Object
#wait_respond(wait_success:, wait_fail: nil, sendback:, timeout: WAIT_TIMEOUT, sensitive: false) ⇒ Object
wait_respond: Waits for the success or failure strings.
wait_success and wait_fail can be strings or arrays. if wait_success is an array, sendback can also be
array (with specific responses for each possible success.
return value is an array
[0] being true/false. true if we found a wait_success value. false if we found a wait_fail value.
[1] being the wait_success / wait_fail value we found.
raises an raise if we hit the timeout.