Class: Chef::Provisioning::Transport::SSH::SSHResult
- Inherits:
-
Object
- Object
- Chef::Provisioning::Transport::SSH::SSHResult
- Defined in:
- lib/chef/provisioning/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.
290 291 292 293 294 295 296 |
# File 'lib/chef/provisioning/transport/ssh.rb', line 290 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.
298 299 300 |
# File 'lib/chef/provisioning/transport/ssh.rb', line 298 def command @command end |
#exitstatus ⇒ Object (readonly)
Returns the value of attribute exitstatus.
302 303 304 |
# File 'lib/chef/provisioning/transport/ssh.rb', line 302 def exitstatus @exitstatus end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
299 300 301 |
# File 'lib/chef/provisioning/transport/ssh.rb', line 299 def @options end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
301 302 303 |
# File 'lib/chef/provisioning/transport/ssh.rb', line 301 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
300 301 302 |
# File 'lib/chef/provisioning/transport/ssh.rb', line 300 def stdout @stdout end |
Instance Method Details
#error! ⇒ Object
304 305 306 307 308 309 310 |
# File 'lib/chef/provisioning/transport/ssh.rb', line 304 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 |