[chef] Re: Prevent LWRP from notifying?


Chronological Thread 
  • From: Jay Feldblum < >
  • To:
  • Subject: [chef] Re: Prevent LWRP from notifying?
  • Date: Mon, 9 Jul 2012 12:07:10 -0400

Brian,

It appears that the pip provider in opscode-cookbooks/python will always mark the resource as updated-by-last-action, regardless of the result of whatever it does under the hood.

Take this bit: https://github.com/opscode-cookbooks/python/blob/e9e4f24d9203446e072f0d15e3d3330310994676/providers/pip.rb#L46-49

It looks like the status variable will always have a truthy value and pass an "if" test because it will always have an instance of Mixlib::ShellOut. The only values that are falsy and fail an "if" test are false and nil; all other values are truthy.

Cheers,
Jay

On Mon, Jul 9, 2012 at 10:32 AM, < " target="_blank"> > wrote:
Currently I am using the python cookbook (authored by opscode).  When
installing a pip with it, it always sends a notification even if it noops
because the pip is installed already.  I was wondering if it is possible for an
LWRP to not send a notification when it NOOPS.

I dug into the resource code a bit and I noticed that most full fledged
providers (like the template resource) use updated_by_last_action.  Is this
what causes the notifications or not?

Any input would be lovely as there are a bunch of processes I'd love to restart
only after a pip has been installed.




Archive powered by MHonArc 2.6.16.

§