summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2016-03-14 15:56:51 -0700
committerNoah Kantrowitz <noah@coderanger.net>2016-03-14 15:56:51 -0700
commit84ee78a74a6873ff1fce2090736413b8fb155ddf (patch)
tree07ca9d2fad656a1c06bf34a48458138006233bb8
parent3f07943715c31dd328dd104bba90d103b744323b (diff)
downloadchef-84ee78a74a6873ff1fce2090736413b8fb155ddf.tar.gz
Setting init_command should be accepted instead of specific command overrides.
Also remove :enable from that list because enable_command isn't a thing on the service resource.
-rw-r--r--lib/chef/provider/service/redhat.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/provider/service/redhat.rb b/lib/chef/provider/service/redhat.rb
index a76622ee8f..2eda4748e3 100644
--- a/lib/chef/provider/service/redhat.rb
+++ b/lib/chef/provider/service/redhat.rb
@@ -60,9 +60,9 @@ class Chef
a.failure_message Chef::Exceptions::Service, "#{chkconfig_file} dbleoes not exist!"
end
- requirements.assert(:start, :enable, :reload, :restart) do |a|
+ requirements.assert(:start, :reload, :restart) do |a|
a.assertion do
- custom_command_for_action?(action) || !@service_missing
+ new_resource.init_command || 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."