[chef] Re: Re: LWRP and new_resource.updated_by_last_action


Chronological Thread 
  • From: Jay Feldblum < >
  • To:
  • Subject: [chef] Re: Re: LWRP and new_resource.updated_by_last_action
  • Date: Wed, 30 Nov 2011 11:18:46 -0500

Martin,

One possibility: the new_resource inside the block may not be the same as the new_resource outside the block.

Try capturing the outer scope's new_resource into a local:

this_resource = new_resource
ruby_block "set_changed" do
  action :nothing
  block do
    this_resource.updated_by_last_action(true)
    Chef::Log.info "PROVIDER CHANGED!!!!!"
  end
end

- Jay

On Wed, Nov 30, 2011 at 10:44 AM, < "> > wrote:

An FYI - making all the resources run at compile time, and setting the
new_resource.updated_by_last_action based upon the actions the same attribute
of the contained resources, though pretty ugly, does work-around the problem.




Archive powered by MHonArc 2.6.16.

§