chef: ImmutableArrays and ImmutableHashes that have not had their cache populated are broken for internal ruby APIs

This is the other half of #6784

% cat ./apply.rb
#!/usr/bin/env chef-apply

node.default['foo']['baz'] = [ "one", "two" ]
puts node['foo']['baz']
% ./apply.rb
[ ... no output ... ]

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (13 by maintainers)

Commits related to this issue

Most upvoted comments

So the actual line which was broken in the cookbook is this:

diff --git a/libraries/helpers_iptables.rb b/libraries/helpers_iptables.rb
index 5797d17..8a0b987 100644
--- a/libraries/helpers_iptables.rb
+++ b/libraries/helpers_iptables.rb
@@ -104,7 +104,7 @@ module FirewallCookbook
         # hash regardless of ipv6 status
         %w(iptables ip6tables).each do |name|
           input[name] = {} unless input[name]
-          input[name].merge!(default_ruleset(current_node))
+          input[name].merge!(default_ruleset(current_node).to_h)
         end
       end
     end

we reverted this, 13.7.x should be the only broken version(s).