Class: KnifeSolo::SshConnection::ExecResult
- Inherits:
-
Object
- Object
- KnifeSolo::SshConnection::ExecResult
- Defined in:
- lib/knife-solo/ssh_connection.rb
Instance Attribute Summary collapse
-
#exit_code ⇒ Object
Returns the value of attribute exit_code.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#stdout ⇒ Object
Returns the value of attribute stdout.
Instance Method Summary collapse
-
#initialize(exit_code = nil) ⇒ ExecResult
constructor
A new instance of ExecResult.
-
#stderr_or_stdout ⇒ Object
Helper to use when raising exceptions since some operations (e.g., command not found) error on stdout.
- #success? ⇒ Boolean
Constructor Details
#initialize(exit_code = nil) ⇒ ExecResult
Returns a new instance of ExecResult.
8 9 10 11 12 |
# File 'lib/knife-solo/ssh_connection.rb', line 8 def initialize(exit_code = nil) @exit_code = exit_code @stdout = "" @stderr = "" end |
Instance Attribute Details
#exit_code ⇒ Object
Returns the value of attribute exit_code.
6 7 8 |
# File 'lib/knife-solo/ssh_connection.rb', line 6 def exit_code @exit_code end |
#stderr ⇒ Object
Returns the value of attribute stderr.
6 7 8 |
# File 'lib/knife-solo/ssh_connection.rb', line 6 def stderr @stderr end |
#stdout ⇒ Object
Returns the value of attribute stdout.
6 7 8 |
# File 'lib/knife-solo/ssh_connection.rb', line 6 def stdout @stdout end |
Instance Method Details
#stderr_or_stdout ⇒ Object
Helper to use when raising exceptions since some operations (e.g., command not found) error on stdout
20 21 22 23 |
# File 'lib/knife-solo/ssh_connection.rb', line 20 def stderr_or_stdout return stderr unless stderr.empty? stdout end |
#success? ⇒ Boolean
14 15 16 |
# File 'lib/knife-solo/ssh_connection.rb', line 14 def success? exit_code == 0 end |