Trouble with Simple Report Handler


#1

Hello, I’m trying to write my first report handler, and I’ve been through the
WIKI and some of jtimbermans blog posts. I’ve got everything working in that
the handler gets registered and runs just fine.

The issue I am having is that when I try to display the list of
updated_resources, the handler is always in the list. Just to make sure I
wasn’t doing something dumb, added a community handler, resulting in two
handlers in my run list. After doing that the updated_resource list always
contains 2 items (both handlers). I seem to be having this exact issue:
http://tickets.opscode.com/browse/COOK-831

I’m testing on 10.12 running on a Centos 5.8 machine. Has anyone else run into
this, or have any suggestions on what I might be doing wrong? My goal is that
on a run where nothing changes, the updated_resources list should contain 0
items.

Thanks


#2

You’re not doing anything wrong. The report handlers have to reload on
each run. You can see that on line 36 of the LWRP.
https://github.com/opscode-cookbooks/chef_handler/blob/master/providers/default.rb

On Thu, Jul 19, 2012 at 8:12 PM, davidpetzel@gmail.com wrote:

Hello, I’m trying to write my first report handler, and I’ve been through
the
WIKI and some of jtimbermans blog posts. I’ve got everything working in
that
the handler gets registered and runs just fine.

The issue I am having is that when I try to display the list of
updated_resources, the handler is always in the list. Just to make sure I
wasn’t doing something dumb, added a community handler, resulting in two
handlers in my run list. After doing that the updated_resource list always
contains 2 items (both handlers). I seem to be having this exact issue:
http://tickets.opscode.com/browse/COOK-831

I’m testing on 10.12 running on a Centos 5.8 machine. Has anyone else run
into
this, or have any suggestions on what I might be doing wrong? My goal is
that
on a run where nothing changes, the updated_resources list should contain 0
items.

Thanks


#3

Just another tidbit. If you load it from the client.rb, I’m fairly certain
it doesn’t do this(if I’m remembering correctly). If you’re keeping an
updated resources metric from each chef run, just decrement it by 1.

On Thu, Jul 19, 2012 at 9:26 PM, Bryan Brandau agent462@gmail.com wrote:

You’re not doing anything wrong. The report handlers have to reload on
each run. You can see that on line 36 of the LWRP.

https://github.com/opscode-cookbooks/chef_handler/blob/master/providers/default.rb

On Thu, Jul 19, 2012 at 8:12 PM, davidpetzel@gmail.com wrote:

Hello, I’m trying to write my first report handler, and I’ve been through
the
WIKI and some of jtimbermans blog posts. I’ve got everything working in
that
the handler gets registered and runs just fine.

The issue I am having is that when I try to display the list of
updated_resources, the handler is always in the list. Just to make sure I
wasn’t doing something dumb, added a community handler, resulting in two
handlers in my run list. After doing that the updated_resource list always
contains 2 items (both handlers). I seem to be having this exact issue:
http://tickets.opscode.com/browse/COOK-831

I’m testing on 10.12 running on a Centos 5.8 machine. Has anyone else run
into
this, or have any suggestions on what I might be doing wrong? My goal is
that
on a run where nothing changes, the updated_resources list should contain
0
items.

Thanks