DrillingInfo/chef-bag_config — pull request #1 by gregsymons (2012-06-15 22:09:53+00:00)
Title: Remove the lookup_cache.

Turns out that if you reuse Chef::Node::Attribute objects, bad things happen.
Basically, the Attribute keeps track of a "nesting" level on access, and unless
you reset it on every access (which you can't) it will go a little nuts and
think that you're nested to a location you're not. For example, if we have node
like so:

{
:some_key => {
:some_other_key => {
:finally_a_leaf_key => 'some value'
:another_leaf => 'some other value'
}
}
}

And we access like so:

node[:some_key][:some_other_key][:finally_a_leaf_key]

Then the lookup cache will look like this:

{
:some_key =>
}

If we then go to try and set a value, like so:

node[:some_key][:a_root_level_key] = 'a root-like value'

Then we get an error that says: "You tried to set a nested key, where the parent
is not a hash-like object:
some_key/some_other_key/finally_a_leaf_key/a_root_level_key" (or something like
that).

So, I took it out.