- From: KC Braunschweig <
>
- To: Chef Dev <
>
- Subject: [chef-dev] need help fixing CHEF-2345 unable to override supports :status for redhat services
- Date: Thu, 7 Jun 2012 13:26:08 +0200
Hoping you guys can help me as I couldn't quite come up with a fix for
this bug. I think the desired feature was that :status should default
to true for Redhat rather than false with other providers, but because
lib/chef/provider/service/redhat.rb does:
@new_resource.supports[:status] = true
The effect is that :status always = true and you can't set it to false
such as if you have a misbehaving 3rd party init script you can't fix.
This is lame. Problem is that the defaults come from the resource code
not the provider so I think that the way to fix this is in
lib/chef/resource/service.rb when the defaults are set:
@supports = { :restart => false, :reload => false, :status => false }
But to do this I need to inspect the provider to know if we're on
redhat, something like:
if provider == 'Chef::Provider::Service::Redhat'
@supports = { :restart => false, :reload => false, :status => true }
else
@supports = { :restart => false, :reload => false, :status => false }
end
But provider is nil at that point. Tried calling straight to
Chef::Platform.provider_for_resource(self) but that doesn't work
either because the run_context isn't set at that point.
Anyone got another angle or a way to make this work?
Thanks,
KC
- [chef-dev] need help fixing CHEF-2345 unable to override supports :status for redhat services, KC Braunschweig, 06/07/2012
Archive powered by MHonArc 2.6.16.