summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaire McQuin <claire@getchef.com>2014-06-27 09:23:26 -0700
committerClaire McQuin <claire@getchef.com>2014-06-27 12:43:55 -0700
commit523886fea9b9803fa312f92761c0a82aa795d558 (patch)
tree4942fd1d527649636379e438750d7dce42b9970e
parentba42749bf65ea7eb6a197b12fa298792a7923034 (diff)
downloadchef-523886fea9b9803fa312f92761c0a82aa795d558.tar.gz
Clean up logic.
-rw-r--r--lib/chef/mixin/shell_out.rb16
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/chef/mixin/shell_out.rb b/lib/chef/mixin/shell_out.rb
index 4e462a17be..97aa7041fd 100644
--- a/lib/chef/mixin/shell_out.rb
+++ b/lib/chef/mixin/shell_out.rb
@@ -49,19 +49,9 @@ class Chef
args = command_args.dup
if args.last.is_a?(Hash)
options = args.last
- if options.has_key?(:environment)
- options_env = options[:environment]
- elsif options.has_key?(:env)
- options_env = options[:env]
- else
- # No environment option provided, make one
- options[:environment] = {}
- options_env = options[:environment]
- end
-
- unless options_env.has_key?('LC_ALL')
- options_env['LC_ALL'] = nil
- end
+ env_key = options.has_key?(:env) ? :env : :environment
+ options[env_key] ||= {}
+ options[env_key]['LC_ALL'] ||= nil
else
args << { :environment => { 'LC_ALL' => nil } }
end