diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-11 17:32:35 -0700 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-20 14:38:05 -0700 |
commit | a6902ea47197a9f2600795a7d1d48713ea05dbd1 (patch) | |
tree | e9d6c481fcdddb96ea7a6c61bfe4ba60bdaf19ff | |
parent | 2cfc73bb1370623e04b5844e5e4a766e27ba3247 (diff) | |
download | chef-a6902ea47197a9f2600795a7d1d48713ea05dbd1.tar.gz |
Display information from DSC
-rw-r--r-- | lib/chef/provider/dsc_resource.rb | 9 | ||||
-rw-r--r-- | lib/chef/util/powershell/cmdlet_result.rb | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/chef/provider/dsc_resource.rb b/lib/chef/provider/dsc_resource.rb index a46e044c23..4c9d866222 100644 --- a/lib/chef/provider/dsc_resource.rb +++ b/lib/chef/provider/dsc_resource.rb @@ -89,7 +89,7 @@ class Chef end def generate_description - "Converge dsc resource" + @converge_description end def module_name @@ -105,6 +105,10 @@ class Chef def test_resource result = invoke_resource(:test) + # We really want this information from the verbose stream, + # however Invoke-DscResource is not correctly writing to that + # stream and instead just dumping to stdout + @converge_description = result.stdout result.return_value[0]["InDesiredState"] end @@ -115,7 +119,8 @@ class Chef def invoke_resource(method, output_format=:object) properties = translate_type(@new_resource.properties) - switches = "-Method #{method.to_s} -Name #{@new_resource.resource} -Property #{properties}" + switches = "-Method #{method.to_s} -Name #{@new_resource.resource}"\ + " -Property #{properties} -Verbose" if module_name != :none switches += " -Module #{module_name}" diff --git a/lib/chef/util/powershell/cmdlet_result.rb b/lib/chef/util/powershell/cmdlet_result.rb index b3e721c92f..f1fdd968b1 100644 --- a/lib/chef/util/powershell/cmdlet_result.rb +++ b/lib/chef/util/powershell/cmdlet_result.rb @@ -30,6 +30,10 @@ class Powershell @streams = streams end + def stdout + @status.stdout + end + def stderr @status.stderr end |