diff options
author | Tim Smith <tsmith84@gmail.com> | 2020-08-07 10:48:39 -0700 |
---|---|---|
committer | Tim Smith <tsmith84@gmail.com> | 2020-08-07 10:48:39 -0700 |
commit | be13cbd6bbdf82a6419bd2612f10db698a963d3d (patch) | |
tree | 8d318b5675ef6ba0198bb57442b870bee1daea84 | |
parent | 0cf94ee19178280f58aa286f7d6ee5ef5bf9c0a7 (diff) | |
download | chef-be13cbd6bbdf82a6419bd2612f10db698a963d3d.tar.gz |
chef_client_systemd_timer: Fix failures in the :remove action
Get the actual systemd action right. Add a kitchen test for this as well.
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | kitchen-tests/cookbooks/end_to_end/recipes/linux.rb | 4 | ||||
-rw-r--r-- | lib/chef/resource/chef_client_systemd_timer.rb | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb b/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb index aad4895246..051a7c9b52 100644 --- a/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb +++ b/kitchen-tests/cookbooks/end_to_end/recipes/linux.rb @@ -102,6 +102,10 @@ chef_client_systemd_timer "Run chef-client as a systemd timer" do only_if { systemd? } end +chef_client_systemd_timer "a timer that does not exist" do + action :remove +end + locale "set system locale" do lang "en_US.UTF-8" only_if { debian? } diff --git a/lib/chef/resource/chef_client_systemd_timer.rb b/lib/chef/resource/chef_client_systemd_timer.rb index 4ca32a08cc..fa59798009 100644 --- a/lib/chef/resource/chef_client_systemd_timer.rb +++ b/lib/chef/resource/chef_client_systemd_timer.rb @@ -112,11 +112,11 @@ class Chef action :remove do systemd_unit "#{new_resource.job_name}.service" do - action :remove + action :delete end systemd_unit "#{new_resource.job_name}.timer" do - action :remove + action :delete end end |