-
Notifications
You must be signed in to change notification settings - Fork 46
Description
Hi,
I found deprecated messages in the ouput running chef-client in my nodes:
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 3 locations:
- /var/chef/cache/cookbooks/timezone-ii/recipes/linux-generic.rb:13:in from_file' - /var/chef/cache/cookbooks/timezone-ii/recipes/linux-generic.rb:14:in from_file'
- /var/chef/cache/cookbooks/timezone-ii/recipes/linux-generic.rb:24:in `from_file'
See https://docs.chef.io/deprecations_attributes.html for further details.
I've checked the url given and try to adapt the lines, (replacing for brackets) but no luck, even if the sintax is correct, when i run chef-client in the node, the message given is diferent :
Modified code:
timezone_data_file = File.join(node["timezone"]["tzdata_dir"], ["node.tz"])
localtime_path = node["timezone"]["localtime_path"]
ruby_block "confirm timezone" do
block {
unless File.exist?(timezone_data_file)
raise "Can't find #{timezone_data_file}!"
end
}
end
if node["timezone"]["use_symlink"]
link localtime_path do
He is the message after running chef-client in the node:
Recipe Compile Error in /var/chef/cache/cookbooks/base/recipes/default.rb
Errno::ENOENT
No such file or directory @ rb_sysopen - /usr/share/zoneinfo/node.tz
Cookbook Trace:
/var/chef/cache/cookbooks/timezone-ii/recipes/linux-generic.rb:34:in
initialize' /var/chef/cache/cookbooks/timezone-ii/recipes/linux-generic.rb:34:inopen'
/var/chef/cache/cookbooks/timezone-ii/recipes/linux-generic.rb:34:inblock in from_file' /var/chef/cache/cookbooks/timezone-ii/recipes/linux-generic.rb:33:infrom_file'
/var/chef/cache/cookbooks/timezone-ii/recipes/default.rb:34:infrom_file' /var/chef/cache/cookbooks/base/recipes/default.rb:8:infrom_file'
So the codes explodes somwhere else.
How can i help to make this recipe compatible with Chef 12.6 (and 13 release) ?
I'm not proficient in ruby but i'm a quick learner.
Thanks.
Regards.