summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/provider/windows_script.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/chef/provider/windows_script.rb b/lib/chef/provider/windows_script.rb
index 050407030a..f46acc60d9 100644
--- a/lib/chef/provider/windows_script.rb
+++ b/lib/chef/provider/windows_script.rb
@@ -43,9 +43,7 @@ class Chef
end
end
- public
-
- action :run do
+ def with_wow64_redirection_disabled
wow64_redirection_state = nil
if wow64_architecture_override_required?(run_context.node, target_architecture)
@@ -53,7 +51,7 @@ class Chef
end
begin
- super()
+ yield
rescue
raise
ensure
@@ -63,6 +61,14 @@ class Chef
end
end
+ public
+
+ action :run do
+ with_wow64_redirection_disabled do
+ super()
+ end
+ end
+
def script_file
@script_file ||= Tempfile.open(["chef-script", script_extension])
end