summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-08-07 12:02:53 -0700
committerGitHub <noreply@github.com>2020-08-07 12:02:53 -0700
commit36638a89a5e7a4e54814b834135ab4fff7ebd6dd (patch)
tree8d318b5675ef6ba0198bb57442b870bee1daea84
parent0cf94ee19178280f58aa286f7d6ee5ef5bf9c0a7 (diff)
parentbe13cbd6bbdf82a6419bd2612f10db698a963d3d (diff)
downloadchef-36638a89a5e7a4e54814b834135ab4fff7ebd6dd.tar.gz
Merge pull request #10273 from chef/fix_action
chef_client_systemd_timer: Fix failures in the :remove action
-rw-r--r--kitchen-tests/cookbooks/end_to_end/recipes/linux.rb4
-rw-r--r--lib/chef/resource/chef_client_systemd_timer.rb4
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