summaryrefslogtreecommitdiff
path: root/lib/chef/util/powershell/cmdlet_result.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/util/powershell/cmdlet_result.rb')
-rw-r--r--lib/chef/util/powershell/cmdlet_result.rb66
1 files changed, 33 insertions, 33 deletions
diff --git a/lib/chef/util/powershell/cmdlet_result.rb b/lib/chef/util/powershell/cmdlet_result.rb
index 4f97658a58..82aef4da40 100644
--- a/lib/chef/util/powershell/cmdlet_result.rb
+++ b/lib/chef/util/powershell/cmdlet_result.rb
@@ -19,43 +19,43 @@
require "chef/json_compat"
class Chef
-class Util
-class Powershell
- class CmdletResult
- attr_reader :output_format
-
- def initialize(status, streams, output_format)
- @status = status
- @output_format = output_format
- @streams = streams
- end
+ class Util
+ class Powershell
+ class CmdletResult
+ attr_reader :output_format
- def stdout
- @status.stdout
- end
-
- def stderr
- @status.stderr
- end
+ def initialize(status, streams, output_format)
+ @status = status
+ @output_format = output_format
+ @streams = streams
+ end
- def stream(name)
- @streams[name].read
- end
+ def stdout
+ @status.stdout
+ end
- def return_value
- if output_format == :object
- Chef::JSONCompat.parse(stream(:json))
- elsif output_format == :json
- stream(:json)
- else
- @status.stdout
- end
- end
+ def stderr
+ @status.stderr
+ end
- def succeeded?
- @succeeded = @status.status.exitstatus == 0
+ def stream(name)
+ @streams[name].read
+ end
+
+ def return_value
+ if output_format == :object
+ Chef::JSONCompat.parse(stream(:json))
+ elsif output_format == :json
+ stream(:json)
+ else
+ @status.stdout
+ end
+ end
+
+ def succeeded?
+ @succeeded = @status.status.exitstatus == 0
+ end
+ end
end
end
end
-end
-end