summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-04-26 16:26:20 -0700
committerTim Smith <tsmith@chef.io>2018-04-26 16:26:20 -0700
commited82d81fb3d1aac8c20fe6ea6101834f39366f19 (patch)
tree0d9100302c41b2b49b3bf3dc59ce1298f3ca7ace
parent7163130cb1209a9565d6137f3e3e6f1eacc94e0f (diff)
downloadchef-ed82d81fb3d1aac8c20fe6ea6101834f39366f19.tar.gz
sysctl: Fix ignore_error being ignoredsysctl_fix
This came into the sysctl cookbook https://github.com/sous-chefs/sysctl/pull/127 Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/chef/resource/sysctl.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/chef/resource/sysctl.rb b/lib/chef/resource/sysctl.rb
index bf6864db31..75d2ef3262 100644
--- a/lib/chef/resource/sysctl.rb
+++ b/lib/chef/resource/sysctl.rb
@@ -84,7 +84,10 @@ class Chef
content "#{new_resource.key} = #{new_resource.value}"
end
- execute "sysctl -p"
+ execute "sysctl -p" do
+ command "sysctl #{'-e ' if new_resource.ignore_error}-p"
+ action :run
+ end
end
end