The following items are new for Chef Infra Client 12.12 and/or are changes from previous versions. The short version: - **New node attribute APIs** Common set of methods to read, write, delete, and check if node attributes exist. - **Data collector updates** Minor enhancements to data that the data collector reports on. - **knife cookbook create has been deprecated** You should use [chef generate cookbook](/ctl_chef/#chef-generate-cookbook) instead. ## New node attribute read, write, unlink, and exist? APIs The four methods `read`, `write`, `unlink`, and `exist?` (and their corresponding unsafe versions) can be used on node objects to set, retrieve, delete, and validate existence of attributes. ### read/read! Use the `read` method to retrieve an attribute value on a node object. It is a safe, non-autovivifying reader that returns `nil` if the attribute does not exist. `node.read("foo", "bar", "baz")` is equivalent to `node["foo"]["bar"]["baz"]` but returns `nil` instead of raising an exception when no value is set. The `read!` method is a non-autovivifying reader that also retrieves an attribute value on a node object; however, it will throw a NoMethodError exception if the attribute does not exist. On the node level, `node.default.read/read!("foo")` behaves similarly to `node.read("foo")`, but only on the default level. ### write/write! Use the `write` method set an attribute value on a node object. It is a safe, autovivifying writer that replaces intermediate non-hash objects. `node.write(:default, "foo", "bar", "baz")` is equivalent to `node.default["foo"]["bar"] = "baz"`. The `write!` method is also an autovivifying method to set an attribute value on a node object; however, it will throw an NoSuchAttribute exception if there is a non-hash on an intermediate key.
Note