Class: LASRpcUtils::AbstractTransport

Inherits:
Object
  • Object
show all
Includes:
MintLogger
Defined in:
src/las-rpc-utils/lib/las-rpc-utils/abstract-transport.rb

Direct Known Subclasses

LocalTransport, SshTransport

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

Instance Method Summary collapse

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_mutexObject

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

#directObject

Returns the value of attribute direct.

#dontkillmeObject

Returns the value of attribute dontkillme.

#eofObject

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!

Returns:

  • (Boolean)

#allocateObject

#allocated?Boolean

Returns:

  • (Boolean)

#buffer_lengthObject

#debug?Boolean

Returns:

  • (Boolean)

#disable_historyObject

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

Returns:

  • (Boolean)

#info?Boolean

Returns:

  • (Boolean)

#logconsole(partial: false, filter: [], split_filter: true, level: 'info', error_loglevel: nil, log_until: -1,, error_only: false) ⇒ Object

#platformObject

#releaseObject

#reserveObject

#reserved?Boolean

Returns:

  • (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

#unallocateObject

#uuidObject

#wait_for_complete(loglevel: 'info', timeout: nil) ⇒ Object

#wait_for_promptObject

#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.