# CHEF-4 - method access to node attributes (node.foo.bar) is deprecated and will be removed

**URL:** <https://discourse.chef.io/t/chef-4-method-access-to-node-attributes-node-foo-bar-is-deprecated-and-will-be-removed/12681>\
**Category:** Chef Infra (archive)\
**Created:** [March 2, 2018, 9:11pm UTC](https://discourse.chef.io/t/chef-4-method-access-to-node-attributes-node-foo-bar-is-deprecated-and-will-be-removed/12681 "2018-03-02T21:11:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiago\_Cruz](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tiago_cruz/32/49_2.png) [@Tiago\_Cruz](https://discourse.chef.io/u/Tiago_Cruz)\
**Post date:** [March 2, 2018, 9:11pm UTC](https://discourse.chef.io/t/chef-4-method-access-to-node-attributes-node-foo-bar-is-deprecated-and-will-be-removed/12681/1 "2018-03-02T21:11:43Z")

</div>

Hello,

I solved lots of CHEF-4 deprecated warnings, but I have no idea how to “solve” this one:

```auto
chef (12.21.31)> 
chef > cluster_nodes = search(:node, tagged_cluster_name).map(&:ipaddress)
[2018-03-02T21:08:59+00:00] WARN: method access to node attributes (node.foo.bar) is deprecated and will be removed in Chef 13, please use bracket syntax (node["foo"]["bar"]) (CHEF-4) at (irb):14:in `map'.
Please see https://docs.chef.io/deprecations_attributes.html for further details and information on how to correct this problem.
[2018-03-02T21:08:59+00:00] WARN: method access to node attributes (node.foo.bar) is deprecated and will be removed in Chef 13, please use bracket syntax (node["foo"]["bar"]) (CHEF-4) at (irb):14:in `map'.
Please see https://docs.chef.io/deprecations_attributes.html for further details and information on how to correct this problem.
[2018-03-02T21:08:59+00:00] WARN: method access to node attributes (node.foo.bar) is deprecated and will be removed in Chef 13, please use bracket syntax (node["foo"]["bar"]) (CHEF-4) at (irb):14:in `map'.
Please see https://docs.chef.io/deprecations_attributes.html for further details and information on how to correct this problem.
 => ["10.110.8.28", "10.110.8.44", "10.110.8.34"] 

```

Thanks!

---

<div class="post-metadata">

**Author:** ![coderanger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/coderanger/32/5_2.png) [@coderanger](https://discourse.chef.io/u/coderanger)\
**Post date:** [March 2, 2018, 9:13pm UTC](https://discourse.chef.io/t/chef-4-method-access-to-node-attributes-node-foo-bar-is-deprecated-and-will-be-removed/12681/2 "2018-03-02T21:13:34Z")

</div>

`.map {|n| n['ipaddress'] }`.

---

<div class="post-metadata">

**Author:** ![Tiago\_Cruz](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tiago_cruz/32/49_2.png) [@Tiago\_Cruz](https://discourse.chef.io/u/Tiago_Cruz)\
**Post date:** [March 2, 2018, 9:15pm UTC](https://discourse.chef.io/t/chef-4-method-access-to-node-attributes-node-foo-bar-is-deprecated-and-will-be-removed/12681/3 "2018-03-02T21:15:55Z")

</div>

> [@coderanger](#):
>
> {|n| n['ipaddress'] }.

Awesome man, thanks!!!

```auto
chef (12.21.31)> cluster_nodes = search(:node, tagged_cluster_name).map {|n| n['ipaddress'] }.sort
 => ["10.110.8.28", "10.110.8.34", "10.110.8.44"] 

```

\o/
