summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-10-24 13:39:03 -0700
committerSerdar Sutay <serdar@opscode.com>2014-10-24 13:39:03 -0700
commit5f8f8095b11bb41d7f199f12ee3e044525d434de (patch)
tree7441b1427ae422f2760d66fd96a1ec8f01764ffa
parent8a3da2f3d77b5cd2e3b3952e257706af5f463244 (diff)
parent8c99535067797411a8e6714ce2379140af8142ae (diff)
downloadchef-5f8f8095b11bb41d7f199f12ee3e044525d434de.tar.gz
Merge pull request #2270 from liseki/fix-whiny-freebsd-service
Ensure why-run of a FreeBSD service missing init script does not fail
-rw-r--r--lib/chef/provider/service/freebsd.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/provider/service/freebsd.rb b/lib/chef/provider/service/freebsd.rb
index e4a456ac25..94f883b35e 100644
--- a/lib/chef/provider/service/freebsd.rb
+++ b/lib/chef/provider/service/freebsd.rb
@@ -62,6 +62,7 @@ class Chef
requirements.assert(:start, :enable, :reload, :restart) do |a|
a.assertion { init_command }
a.failure_message Chef::Exceptions::Service, "#{new_resource}: unable to locate the rc.d script"
+ a.whyrun("Assuming rc.d script will be installed by a previous action.")
end
requirements.assert(:all_actions) do |a|
@@ -72,7 +73,7 @@ class Chef
end
requirements.assert(:start, :enable, :reload, :restart) do |a|
- a.assertion { init_command && service_enable_variable_name != nil }
+ a.assertion { service_enable_variable_name != nil }
a.failure_message Chef::Exceptions::Service, "Could not find the service name in #{init_command} and rcvar"
# No recovery in whyrun mode - the init file is present but not correct.
end