diff options
author | Pete Higgins <pete@peterhiggins.org> | 2020-05-28 18:10:42 -0700 |
---|---|---|
committer | Pete Higgins <pete@peterhiggins.org> | 2020-06-03 11:46:53 -0700 |
commit | b0a0e868692f9ac8f124ae640110c513d43b5324 (patch) | |
tree | 3ab67c54a9b2130ac07bdb3eefa0ec605ab1d8e7 /lib | |
parent | 6ffb5cafd1292a0a5f2149f82e2b978db120607d (diff) | |
download | chef-b0a0e868692f9ac8f124ae640110c513d43b5324.tar.gz |
Move some code out of the action block to its own method.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/provider/windows_script.rb | 14 |
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 |