Need info on chef handler warning please?

I’m playing with Chef handlers, and have the following in a recipe, which simple creates an empty /tmp/node_is_bootstrapped.txt file, and it works.

chef_handler ‘Chef::Handler::ReportNodeBootstrapped’ do
source "/tmp/some_handler.rb"
supports :report => true
action :enable
end

However, I get this warning

chef_handler[Chef::Handler::ReportNodeBootstrapped] action enable[2015-06-26T16:09:08-04:00] WARN: Using an LWRP by its name (Chef::Resource::ChefHandler) directly is no longer supported in Chef 13 and will be removed. Use Chef::Resource.resource_for_node(node, name) instead.

Where is the documentation to explain how to do this? IOW, how would the chef_handler resource call change? What do I put in ‘node’ and ‘name’

Chef_handler ‘Chef::Resource.resource_for_node(node, name)’ do
source "/tmp/some_handler.rb"
supports :report => true
action :enable
end

Chris

The LWRP in the recipe needs to be updated. Assuming you’re using the standard community chef handler cookbook, you don’t need to worry about this, aside from upgrading the cookbook before you upgrade to Chef 13.0 (far future).

--
Daniel DeLeo

On Friday, June 26, 2015 at 1:29 PM, Fouts, Chris wrote:

I’m playing with Chef handlers, and have the following in a recipe, which simple creates an empty /tmp/node_is_bootstrapped.txt file, and it works.

chef_handler 'Chef::Handler::ReportNodeBootstrapped' do
source "/tmp/some_handler.rb"
supports :report => true
action :enable
end

However, I get this warning

chef_handler[Chef::Handler::ReportNodeBootstrapped] action enable[2015-06-26T16:09:08-04:00] WARN: Using an LWRP by its name (Chef::Resource::ChefHandler) directly is no longer supported in Chef 13 and will be removed. Use Chef::Resource.resource_for_node(node, name) instead.

Where is the documentation to explain how to do this? IOW, how would the chef_handler resource call change? What do I put in ‘node’ and ‘name’

Chef_handler ‘Chef::Resource.resource_for_node(node, name)’ do
source "/tmp/some_handler.rb"
supports :report => true
action :enable
end

Chris

I'm using the community chef_handler cookbook. What do I need to do to "upgrade the cookbook," which Is my original question.

Another question, inferring from your response, is I shouldn't upgrade the cookbook "now" since the Chef 13 format is not compatible with Chef 12?

Chris

-----Original Message-----
From: Daniel DeLeo [mailto:ddeleo@kallistec.com] On Behalf Of Daniel DeLeo
Sent: Friday, June 26, 2015 4:33 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Need info on chef handler warning please?

The LWRP in the recipe needs to be updated. Assuming you’re using the standard community chef handler cookbook, you don’t need to worry about this, aside from upgrading the cookbook before you upgrade to Chef 13.0 (far future).

--
Daniel DeLeo

On Friday, June 26, 2015 at 1:29 PM, Fouts, Chris wrote:

I’m playing with Chef handlers, and have the following in a recipe, which simple creates an empty /tmp/node_is_bootstrapped.txt file, and it works.

chef_handler 'Chef::Handler::ReportNodeBootstrapped' do source
"/tmp/some_handler.rb"
supports :report => true
action :enable
end

However, I get this warning

chef_handler[Chef::Handler::ReportNodeBootstrapped] action enable[2015-06-26T16:09:08-04:00] WARN: Using an LWRP by its name (Chef::Resource::ChefHandler) directly is no longer supported in Chef 13 and will be removed. Use Chef::Resource.resource_for_node(node, name) instead.

Where is the documentation to explain how to do this? IOW, how would the chef_handler resource call change? What do I put in ‘node’ and ‘name’

Chef_handler ‘Chef::Resource.resource_for_node(node, name)’ do source
"/tmp/some_handler.rb"
supports :report => true
action :enable
end

Chris

The cookbook update isn't done yet. Daniel means when there is an update
for it just update as usual and you will be fine, so long as you update
before Chef 13 comes out. For now ignore the warning.

Pretty sure those warnings only came up because Chef 12.4/Chef Server 12.1
were just released (in the last few days), right?

On Fri, Jun 26, 2015 at 1:50 PM, Fouts, Chris Chris.Fouts@sensus.com
wrote:

I'm using the community chef_handler cookbook. What do I need to do to
"upgrade the cookbook," which Is my original question.

Another question, inferring from your response, is I shouldn't upgrade the
cookbook "now" since the Chef 13 format is not compatible with Chef 12?

Chris

-----Original Message-----
From: Daniel DeLeo [mailto:ddeleo@kallistec.com] On Behalf Of Daniel DeLeo
Sent: Friday, June 26, 2015 4:33 PM
To: chef@lists.opscode.com
Subject: [chef] Re: Need info on chef handler warning please?

The LWRP in the recipe needs to be updated. Assuming you’re using the
standard community chef handler cookbook, you don’t need to worry about
this, aside from upgrading the cookbook before you upgrade to Chef 13.0
(far future).

--
Daniel DeLeo

On Friday, June 26, 2015 at 1:29 PM, Fouts, Chris wrote:

I’m playing with Chef handlers, and have the following in a recipe,
which simple creates an empty /tmp/node_is_bootstrapped.txt file, and it
works.

chef_handler 'Chef::Handler::ReportNodeBootstrapped' do source
"/tmp/some_handler.rb"
supports :report => true
action :enable
end

However, I get this warning

chef_handler[Chef::Handler::ReportNodeBootstrapped] action
enable[2015-06-26T16:09:08-04:00] WARN: Using an LWRP by its name
(Chef::Resource::ChefHandler) directly is no longer supported in Chef 13
and will be removed. Use Chef::Resource.resource_for_node(node, name)
instead.

Where is the documentation to explain how to do this? IOW, how would the
chef_handler resource call change? What do I put in ‘node’ and ‘name’

Chef_handler ‘Chef::Resource.resource_for_node(node, name)’ do source
"/tmp/some_handler.rb"
supports :report => true
action :enable
end

Chris

--
Yoshi Spendiff
Ops Engineer
Indochino
Mobile: +1 778 952 2025
Email: yoshi.spendiff@indochino.com

On Friday, June 26, 2015 at 1:57 PM, Yoshi Spendiff wrote:

The cookbook update isn't done yet. Daniel means when there is an update for it just update as usual and you will be fine, so long as you update before Chef 13 comes out. For now ignore the warning.

Pretty sure those warnings only came up because Chef 12.4/Chef Server 12.1 were just released (in the last few days), right?
This is correct. Chef 12.4 deprecates some LWRP usages (that may in fact be pretty common). If you are the author of a cookbook that causes these warnings, then you should update the cookbook when you are able. If you are a consumer of a cookbook that causes these warnings, you can sit tight and give the maintainers time to address them (or you can contribute a fix!), then upgrade the cookbook when the new version comes out. But generally you don’t need to worry about it until you’re ready to upgrade to Chef 13.0+, which is far in the future (there is currently no plan to release it, so it will be months or more before this happens).

--
Daniel DeLeo