diff options
author | Seth Chisamore <schisamo@opscode.com> | 2012-11-13 16:50:12 -0500 |
---|---|---|
committer | Seth Chisamore <schisamo@opscode.com> | 2012-11-13 17:27:53 -0500 |
commit | a4977611d2db2a12a66e4502839e11f24aa8abfa (patch) | |
tree | cbc2fed0235d58d14b9ff316c1aec38808f2950e /lib/chef/provider/service/init.rb | |
parent | 6317bf5f07f70b8ec70ad254a5b8b3aca9b6bbe7 (diff) | |
download | chef-a4977611d2db2a12a66e4502839e11f24aa8abfa.tar.gz |
[CHEF-3604] why run assertions should pass on custom service commands
Diffstat (limited to 'lib/chef/provider/service/init.rb')
-rw-r--r-- | lib/chef/provider/service/init.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/provider/service/init.rb b/lib/chef/provider/service/init.rb index 2dd03679c5..09f47e866f 100644 --- a/lib/chef/provider/service/init.rb +++ b/lib/chef/provider/service/init.rb @@ -37,7 +37,9 @@ class Chef # do not call super here, inherit only shared_requirements shared_resource_requirements requirements.assert(:start, :stop, :restart, :reload) do |a| - a.assertion { ::File.exist?(default_init_command) } + a.assertion do + custom_command_for_action?(action) || ::File.exist?(default_init_command) + end a.failure_message(Chef::Exceptions::Service, "#{default_init_command} does not exist!") a.whyrun("Init script '#{default_init_command}' doesn't exist, assuming a prior action would have created it.") do # blindly assume that the service exists but is stopped in why run mode: |