diff options
author | Tim Smith <tsmith@chef.io> | 2018-07-10 09:31:20 -0700 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-07-10 09:31:20 -0700 |
commit | 4ab5fbadd8da5c5d66ecc37fe3c211dc1023d4d0 (patch) | |
tree | 2fd5897d60282d646a1d7bfa6cfd826b5aed812e /lib/chef/resource/sysctl.rb | |
parent | 97c16593dc6eb4ce0a14eecadf4fdbf90d4d0dbd (diff) | |
download | chef-4ab5fbadd8da5c5d66ecc37fe3c211dc1023d4d0.tar.gz |
Fixes from the review
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/resource/sysctl.rb')
-rw-r--r-- | lib/chef/resource/sysctl.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/resource/sysctl.rb b/lib/chef/resource/sysctl.rb index 1b08ccbd0e..e03b7a362c 100644 --- a/lib/chef/resource/sysctl.rb +++ b/lib/chef/resource/sysctl.rb @@ -50,8 +50,8 @@ class Chef default: "/etc/sysctl.d" def after_created - raise "The systctl resource requires Linux as it needs sysctl and the systctl.d directory functionality." unless node["os"] == "linux" - raise "The systctl resource does not support SLES releases less than 12 as it requires a systctl.d directory" if platform_family?("suse") && node["platform_version"].to_i < 12 + raise "The sysctl resource requires Linux as it needs sysctl and the sysctl.d directory functionality." unless node["os"] == "linux" + raise "The sysctl resource does not support SLES releases less than 12 as it requires a sysctl.d directory" if platform_family?("suse") && node["platform_version"].to_i < 12 end def coerce_value(v) @@ -63,16 +63,16 @@ class Chef end end - # shellout to systctl to get the current value + # shellout to sysctl to get the current value # ignore missing keys by using '-e' - # convert tabs to spaces since systctl tab deliminates multivalue parameters + # convert tabs to spaces since sysctl tab deliminates multivalue parameters # strip the newline off the end of the output as well load_current_value do value shell_out!("sysctl -n -e #{key}").stdout.tr("\t", " ").strip end action :apply do - description "Apply a systctl value." + description "Apply a sysctl value." converge_if_changed do # set it temporarily @@ -97,7 +97,7 @@ class Chef # only converge the resource if the file actually exists to delete if ::File.exist?("#{new_resource.conf_dir}/99-chef-#{new_resource.key}.conf") - converge_by "removing systctl config at #{new_resource.conf_dir}/99-chef-#{new_resource.key}.conf" do + converge_by "removing sysctl config at #{new_resource.conf_dir}/99-chef-#{new_resource.key}.conf" do file "#{new_resource.conf_dir}/99-chef-#{new_resource.key}.conf" do action :delete end |