Class: ChefMetal::Transport::WinRM::WinRMResult
- Inherits:
-
Object
- Object
- ChefMetal::Transport::WinRM::WinRMResult
- Defined in:
- lib/chef_metal/transport/winrm.rb
Instance Attribute Summary collapse
-
#exitstatus ⇒ Object
readonly
Returns the value of attribute exitstatus.
-
#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(output) ⇒ WinRMResult
constructor
A new instance of WinRMResult.
Constructor Details
#initialize(output) ⇒ WinRMResult
Returns a new instance of WinRMResult.
71 72 73 74 75 76 77 78 79 |
# File 'lib/chef_metal/transport/winrm.rb', line 71 def initialize(output) @exitstatus = output[:exitcode] @stdout = '' @stderr = '' output[:data].each do |data| @stdout << data[:stdout] if data[:stdout] @stderr << data[:stderr] if data[:stderr] end end |
Instance Attribute Details
#exitstatus ⇒ Object (readonly)
Returns the value of attribute exitstatus.
83 84 85 |
# File 'lib/chef_metal/transport/winrm.rb', line 83 def exitstatus @exitstatus end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
82 83 84 |
# File 'lib/chef_metal/transport/winrm.rb', line 82 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
81 82 83 |
# File 'lib/chef_metal/transport/winrm.rb', line 81 def stdout @stdout end |
Instance Method Details
#error! ⇒ Object
85 86 87 |
# File 'lib/chef_metal/transport/winrm.rb', line 85 def error! raise "Error: code #{exitstatus}.\nSTDOUT:#{stdout}\nSTDERR:#{stderr}" if exitstatus != 0 end |