summaryrefslogtreecommitdiff
path: root/lib/mixlib/shellout.rb
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2013-06-14 15:28:50 -0700
committersersut <serdar@opscode.com>2013-06-14 15:28:50 -0700
commit596d523e718713b3d772f44e5dbbf122c1b84a18 (patch)
tree6ef165aced11136b713e2e9cc87d039ba87561f5 /lib/mixlib/shellout.rb
parent29ea7170762c01fd0e107a81e5aecde9a298099b (diff)
downloadmixlib-shellout-596d523e718713b3d772f44e5dbbf122c1b84a18.tar.gz
Make sure the parent process' LC_ALL setting is passed to subprocess when LC_ALL is set to nil in the :environment setting.
Diffstat (limited to 'lib/mixlib/shellout.rb')
-rw-r--r--lib/mixlib/shellout.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/mixlib/shellout.rb b/lib/mixlib/shellout.rb
index 63744f1..a267162 100644
--- a/lib/mixlib/shellout.rb
+++ b/lib/mixlib/shellout.rb
@@ -290,8 +290,14 @@ module Mixlib
when 'log_tag'
self.log_tag = setting
when 'environment', 'env'
+ # Set the LC_ALL from the parent process if the user wanted
+ # to use the default.
+ if setting && setting.has_key?("LC_ALL") && setting['LC_ALL'].nil?
+ setting['LC_ALL'] = ENV['LC_ALL']
+ end
# passing :environment => nil means don't set any new ENV vars
@environment = setting.nil? ? {} : @environment.dup.merge!(setting)
+
else
raise InvalidCommandOption, "option '#{option.inspect}' is not a valid option for #{self.class.name}"
end