summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@may.lt>2015-10-05 16:46:50 +0100
committerThom May <thom@may.lt>2015-10-05 16:46:50 +0100
commitc762d1b21477f5d57c2ff5e5e2c7b04a2d5cf934 (patch)
tree60d6483fe93ed13a20bc108427b31f48c4ebdfcc
parent132c85844dfdaef1d5acfe2bb272f961147509d8 (diff)
parent0dc4ae50f145ea81c1faae45326dc3f59a57798d (diff)
downloadchef-c762d1b21477f5d57c2ff5e5e2c7b04a2d5cf934.tar.gz
Merge pull request #4000 from chef/ad/3992-redhat-service
Fix for #3992: Add check for custom command in redhat service provider
-rw-r--r--lib/chef/provider/service/redhat.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/provider/service/redhat.rb b/lib/chef/provider/service/redhat.rb
index 33a9778715..3ad11a7672 100644
--- a/lib/chef/provider/service/redhat.rb
+++ b/lib/chef/provider/service/redhat.rb
@@ -61,8 +61,10 @@ class Chef
end
requirements.assert(:start, :enable, :reload, :restart) do |a|
- a.assertion { !@service_missing }
- a.failure_message Chef::Exceptions::Service, "#{new_resource}: unable to locate the init.d script!"
+ a.assertion do
+ custom_command_for_action?(action) || !@service_missing
+ end
+ a.failure_message Chef::Exceptions::Service, "#{new_resource}: No custom command for #{action} specified and unable to locate the init.d script!"
a.whyrun "Assuming service would be disabled. The init script is not presently installed."
end
end