diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-09-03 15:25:08 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-09-08 11:10:07 -0700 |
commit | b534056debd3b1f5a6c0df58dad7cfc34634dbd3 (patch) | |
tree | 4f7ca7c753f9f17c508a97aed524b4ec73266c5b /lib/chef/mixin/shell_out.rb | |
parent | ac080bb63f13d5a340e40e65183474079050a029 (diff) | |
download | chef-b534056debd3b1f5a6c0df58dad7cfc34634dbd3.tar.gz |
Marshall.dump can't dump an IO
which can be an argument to shell_out which means that we have to
manually dup things before mutating.
Diffstat (limited to 'lib/chef/mixin/shell_out.rb')
-rw-r--r-- | lib/chef/mixin/shell_out.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/mixin/shell_out.rb b/lib/chef/mixin/shell_out.rb index 3af71d11b9..82772b584a 100644 --- a/lib/chef/mixin/shell_out.rb +++ b/lib/chef/mixin/shell_out.rb @@ -33,12 +33,14 @@ class Chef # we use 'en_US.UTF-8' by default because we parse localized strings in English as an API and # generally must support UTF-8 unicode. def shell_out(*command_args) - args = Marshal.load( Marshal.dump(command_args) ) # we need a deep clone + args = command_args.dup if args.last.is_a?(Hash) - options = args.last + options = args.pop.dup env_key = options.has_key?(:env) ? :env : :environment options[env_key] ||= {} + options[env_key] = options[env_key].dup options[env_key]['LC_ALL'] ||= Chef::Config[:internal_locale] unless options[env_key].has_key?('LC_ALL') + args << options else args << { :environment => { 'LC_ALL' => Chef::Config[:internal_locale] } } end |