summaryrefslogtreecommitdiff
path: root/lib/chef/provider
diff options
context:
space:
mode:
authorPeter Walz <pnw@umn.edu>2016-10-18 13:56:12 -0500
committerPeter Walz <pnw@umn.edu>2016-10-18 13:56:12 -0500
commit7503df7c135fd20beb9c64300f92d7dd73f3936a (patch)
treeec00307ee827e7d8df4470a2a447f16e4c2620a6 /lib/chef/provider
parent389078064c78c186a81c7d63c33649ac68b9a132 (diff)
downloadchef-7503df7c135fd20beb9c64300f92d7dd73f3936a.tar.gz
Remove leading and trailing quotes when reading certain environment variables
Fixes a side effect of #5127 where if a `cron` resource sets MAILTO, PATH, SHELL, or HOME, it gets updated with every chef-client run. Signed-off-by: Peter Walz <pnw@umn.edu>
Diffstat (limited to 'lib/chef/provider')
-rw-r--r--lib/chef/provider/cron.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/cron.rb b/lib/chef/provider/cron.rb
index 7baaeec0c5..4a9a73cd27 100644
--- a/lib/chef/provider/cron.rb
+++ b/lib/chef/provider/cron.rb
@@ -199,7 +199,7 @@ class Chef
def set_environment_var(attr_name, attr_value)
if %w{MAILTO PATH SHELL HOME}.include?(attr_name)
- @current_resource.send(attr_name.downcase.to_sym, attr_value)
+ @current_resource.send(attr_name.downcase.to_sym, attr_value.gsub(/^"|"$/, ''))
else
@current_resource.environment(@current_resource.environment.merge(attr_name => attr_value))
end