diff options
author | Bryan McLellan <btm@loftninjas.org> | 2014-12-17 12:12:49 -0500 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2014-12-17 12:12:49 -0500 |
commit | 0b27affcdb9145b3bd133948bab0b38fb7481a0c (patch) | |
tree | 0a71f9353cfaee3458fcb7bbd125b4a1f6f985e4 /lib | |
parent | 34a8affc37f80e6a742dbe8a130513897e6512a8 (diff) | |
parent | 2e7ffaa7d83343379476fd353cb2f5a351ba090e (diff) | |
download | chef-0b27affcdb9145b3bd133948bab0b38fb7481a0c.tar.gz |
Merge pull request #2661 from opscode/btm/appveyor11.18.0.r
Combination of all current PRs against master to get appveyor passing. Closes #2655, #2653, #2644, #2670.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/powershell_script.rb | 4 | ||||
-rw-r--r-- | lib/chef/provider/script.rb | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/chef/provider/powershell_script.rb b/lib/chef/provider/powershell_script.rb index 0e76cd1656..96955f73b6 100644 --- a/lib/chef/provider/powershell_script.rb +++ b/lib/chef/provider/powershell_script.rb @@ -43,7 +43,7 @@ class Chef code.to_s + EXIT_STATUS_NORMALIZATION_SCRIPT ) convert_boolean_return = @new_resource.convert_boolean_return - @code = <<EOH + self.code = <<EOH new-variable -name interpolatedexitcode -visibility private -value $#{convert_boolean_return} new-variable -name chefscriptresult -visibility private $chefscriptresult = { @@ -52,7 +52,7 @@ $chefscriptresult = { if ($interpolatedexitcode -and $chefscriptresult.gettype().name -eq 'boolean') { exit [int32](!$chefscriptresult) } else { exit 0 } EOH Chef::Log.debug("powershell_script provider called with script code:\n\n#{code}\n") - Chef::Log.debug("powershell_script provider will execute transformed code:\n\n#{@code}\n") + Chef::Log.debug("powershell_script provider will execute transformed code:\n\n#{self.code}\n") end public diff --git a/lib/chef/provider/script.rb b/lib/chef/provider/script.rb index ea286cb0e4..e8b5235b7a 100644 --- a/lib/chef/provider/script.rb +++ b/lib/chef/provider/script.rb @@ -32,10 +32,13 @@ class Chef provides :ruby provides :script - def_delegators :@new_resource, :code, :interpreter, :flags + def_delegators :@new_resource, :interpreter, :flags + + attr_accessor :code def initialize(new_resource, run_context) super + self.code = new_resource.code end def command |