You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
machine "myserver" do
attributes node["people"]
end
example.rb will raise the following exception:
Chef::Exceptions::ImmutableAttributeModification: machine[myserver] (example::example line 3) had an error: Chef::Exceptions::ImmutableAttributeModification: Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'
In order to get the code to work you currently need to convert the node["people"] Chef::Node::ImmutableMash to a hash:
recipes/example.rb
machine "myserver" do
attributes node["people"].to_hash
end
The text was updated successfully, but these errors were encountered:
For example:
attributes/default.rb:
recipes/example.rb
example.rb will raise the following exception:
Chef::Exceptions::ImmutableAttributeModification: machine[myserver] (example::example line 3) had an error: Chef::Exceptions::ImmutableAttributeModification: Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'
In order to get the code to work you currently need to convert the node["people"] Chef::Node::ImmutableMash to a hash:
recipes/example.rb
The text was updated successfully, but these errors were encountered: