- From: Noah Gibbs <
>
- To:
- Subject: [chef] Re: Notifies with an unsupported action
- Date: Tue, 11 Jan 2011 12:16:31 -0800 (PST)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=24a1EVZ5zWxT3EoTc2G2oUh8JdBCTdI6o9Y8eTcXbxgHHZj2xwjnCVkVrCQLLnkMrlUwT2ibkZ7WyF2KLHCQIWowRoZVPTX3hnNxWbDYhsPDHhZ/wh5BXc0bEvj9zxipNJ4xYsD2O1DdYyAxfXLnZjrt7ChRiZ1BKbBu6sQa6HA=;
To me, it definitely makes sense to at the very least warn when an
unsupported operation is given. Mysterious no-ops are probably the most
frustrating part of my current beginner experience with Chef, and tracking
them down is often painful (I'm currently tracking down a mysterious no-op on
"supports" with a User block and :manage_home => true, and another mysterious
no-op on a cookbook_file block).
Turning typos or requests for unsupported operations into mysterious no-ops
does beginners no favors.
--- On Tue, 1/11/11, Mark J. Reed
<
>
wrote:
>
From: Mark J. Reed
>
<
>
>
Subject: [chef] Notifies with an unsupported action
>
To:
>
>
Date: Tuesday, January 11, 2011, 12:13 PM
>
Soliciting opinions here.
>
IYESHO, what should happen in this situation?
>
>
service "foo" do
>
supports :restart => false
>
end
>
>
file "blah" do
>
notifies :restart, "service[foo]"
>
end
>
>
Right now, it depends upon the provider. The init
>
provider will
>
translate the restart action into a sequence of stop, start
>
actions.
>
The upstart provider will ignore the "supports" declaration
>
and call
>
restart anyway.
>
>
The current behavior is defensible; the "supports"
>
declaration is
>
clearly a lie for any Upstart service. I'm just
>
trying to work around
>
an issue (http://tickets.opscode.com/browse/CHEF-1971) wherein
>
"restart" doesn't work the way Chef expects it to for
>
Upstart
>
services.
>
>
I wonder if it would make more sense to handle 'supports'
>
at a higher
>
level and reject any attempt to send an action that is
>
declared as
>
unsupported. Or at least have the service resource
>
itself, rather
>
than the individual providers, handle things like
>
translating restart
>
into stop/start.
>
>
Thoughts?
>
>
--
>
Mark J. Reed
>
<
>
>
Archive powered by MHonArc 2.6.16.