Class: Chef::Provisioning::Transport::WinRM::WinRMResult
- Inherits:
-
Object
- Object
- Chef::Provisioning::Transport::WinRM::WinRMResult
- Defined in:
- lib/chef/provisioning/transport/winrm.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#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, config, output) ⇒ WinRMResult
constructor
A new instance of WinRMResult.
Constructor Details
#initialize(command, options, config, output) ⇒ WinRMResult
Returns a new instance of WinRMResult.
117 118 119 120 121 122 123 124 |
# File 'lib/chef/provisioning/transport/winrm.rb', line 117 def initialize(command, , config, output) @command = command @options = @config = config @exitstatus = output.exitcode @stdout = output.stdout @stderr = output.stderr end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
129 130 131 |
# File 'lib/chef/provisioning/transport/winrm.rb', line 129 def command @command end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
131 132 133 |
# File 'lib/chef/provisioning/transport/winrm.rb', line 131 def config @config end |
#exitstatus ⇒ Object (readonly)
Returns the value of attribute exitstatus.
128 129 130 |
# File 'lib/chef/provisioning/transport/winrm.rb', line 128 def exitstatus @exitstatus end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
130 131 132 |
# File 'lib/chef/provisioning/transport/winrm.rb', line 130 def @options end |
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
127 128 129 |
# File 'lib/chef/provisioning/transport/winrm.rb', line 127 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
126 127 128 |
# File 'lib/chef/provisioning/transport/winrm.rb', line 126 def stdout @stdout end |
Instance Method Details
#error! ⇒ Object
133 134 135 136 137 138 139 140 |
# File 'lib/chef/provisioning/transport/winrm.rb', line 133 def error! if exitstatus != 0 msg = "Error: command '#{command}' exited with code #{exitstatus}.\n" msg << "STDOUT: #{stdout}" if ![:stream] && ![:stream_stdout] && config[:log_level] != :debug msg << "STDERR: #{stderr}" if ![:stream] && ![:stream_stderr] && config[:log_level] != :debug raise msg end end |