summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandy-dufour <adufour@chef.io>2015-09-29 16:34:56 -0400
committerandy-dufour <adufour@chef.io>2015-09-29 16:34:56 -0400
commit5d890056a1e8782af98b3d4efe4dded3494404c9 (patch)
tree9e5d9fbbc4209f80fb6f3917fc27560c8c593e6d
parentbc82c3e8603f6908d80fc29beb1d0902563398e7 (diff)
downloadchef-5d890056a1e8782af98b3d4efe4dded3494404c9.tar.gz
Adding check for custom command in redhat service provider and providing more explicit error message if init.d script or custom command is not found.
-rw-r--r--lib/chef/provider/service/redhat.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/provider/service/redhat.rb b/lib/chef/provider/service/redhat.rb
index 33a9778715..dd44e441a8 100644
--- a/lib/chef/provider/service/redhat.rb
+++ b/lib/chef/provider/service/redhat.rb
@@ -61,7 +61,9 @@ class Chef
end
requirements.assert(:start, :enable, :reload, :restart) do |a|
- a.assertion { !@service_missing }
+ a.assertion do
+ custom_command_for_action?(action) || !@service_missing
+ end
a.failure_message Chef::Exceptions::Service, "#{new_resource}: unable to locate the init.d script!"
a.whyrun "Assuming service would be disabled. The init script is not presently installed."
end