Chef 12.13.30 "method access to node attributes" Deprecation warnings on template

Ohai Chefs!

Recently upgraded to chef 12.13.30 - and have been going thru the latest round of deprecation warnings at the end of the chef run to ensure my cookbooks are up to date.

The most recent warning is the following:

Deprecated features used!
method access to node attributes (node.foo.bar) is deprecated and will be removed in Chef 13, please use bracket syntax (node[“foo”][“bar”]) at 1 location:
- (erubis):1:in `block in evaluate’

So it appears to be a template that is matching method based access to node attributes, but even with debug log doesn’t display the path or any info about the template itself. Anyone have an idea on how we can get this deprecation warnings to serve up the template or filename so we can find and fix?

export CHEF_TREAT_DEPRECATION_WARNINGS_AS_ERRORS=1 and re-run, it should give you a full traceback from the sad code. You can also set that on the command line as --config-option treat_deprecation_warnings_as_errors=true or config file.

2 Likes

awesome, that gives me loads of useful info to track this down.

Thanks!

Is there a good way to check for deprecations only on cookbooks you maintain? I know I’ve seen deprecation warnings from stuff like the cron cookbook in the past, but I only really care about our own cookbooks, not community ones. ISTR there was some new tool similar to rubocop but chef-specific, to serve as an ancillary to foodcritic, but I’m totally spacing on the name (and whether or not it would even help in a scenario like this).

Nathan Clemons
DevOps Engineer
Moxie Cloud Services (MCS)

O +1.425.467.5075
M +1.360.861.6291
E nclemons@gomoxie.com
W www.gomoxie.comhttp://www.gomoxie.com/

Not currently that I know of.