Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated Functions on Chef Server 12.6.0 #38

Open
fquiroga opened this issue Mar 11, 2017 · 0 comments
Open

Deprecated Functions on Chef Server 12.6.0 #38

fquiroga opened this issue Mar 11, 2017 · 0 comments

Comments

@fquiroga
Copy link

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:in open'
/var/chef/cache/cookbooks/timezone-ii/recipes/linux-generic.rb:34:in block in from_file' /var/chef/cache/cookbooks/timezone-ii/recipes/linux-generic.rb:33:in from_file'
/var/chef/cache/cookbooks/timezone-ii/recipes/default.rb:34:in from_file' /var/chef/cache/cookbooks/base/recipes/default.rb:8:in from_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.

@fquiroga fquiroga changed the title Deprecated Funtions on Chef Server 12.6.0 Deprecated Functions on Chef Server 12.6.0 Mar 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant