Class: ChefMetal::Transport::SSH::SSHResult
- Inherits:
-
Object
- Object
- ChefMetal::Transport::SSH::SSHResult
- Defined in:
- lib/chef_metal/transport/ssh.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#exitstatus ⇒ Object
readonly
Returns the value of attribute exitstatus.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
- #error! ⇒ Object
-
#initialize(command, options, stdout, stderr, exitstatus) ⇒ SSHResult
constructor
A new instance of SSHResult.
Constructor Details
#initialize(command, options, stdout, stderr, exitstatus) ⇒ SSHResult
Returns a new instance of SSHResult.
188 189 190 191 192 193 194 |
# File 'lib/chef_metal/transport/ssh.rb', line 188 def initialize(command, , stdout, stderr, exitstatus) @command = command @options = @stdout = stdout @stderr = stderr @exitstatus = exitstatus end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
196 197 198 |
# File 'lib/chef_metal/transport/ssh.rb', line 196 def command @command end |
#exitstatus ⇒ Object (readonly)
Returns the value of attribute exitstatus.
200 201 202 |
# File 'lib/chef_metal/transport/ssh.rb', line 200 def exitstatus @exitstatus end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
197 198 199 |
# File 'lib/chef_metal/transport/ssh.rb', line 197 def @options end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
199 200 201 |
# File 'lib/chef_metal/transport/ssh.rb', line 199 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
198 199 200 |
# File 'lib/chef_metal/transport/ssh.rb', line 198 def stdout @stdout end |
Instance Method Details
#error! ⇒ Object
202 203 204 205 206 207 208 |
# File 'lib/chef_metal/transport/ssh.rb', line 202 def error! if exitstatus != 0 # TODO stdout/stderr is already printed at info/debug level. Let's not print it twice, it's a lot. msg = "Error: command '#{command}' exited with code #{exitstatus}.\n" raise msg end end |