diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2016-11-14 10:27:30 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2016-11-14 10:27:30 -0800 |
commit | 7524f955aea038b45089f56d64bcb0f557cfb26d (patch) | |
tree | 753801e9951676889d2344c804ec1ed21a4f2d02 | |
parent | ed93e0fb1644643cb0d064776b3283401dfba9a7 (diff) | |
download | chef-7524f955aea038b45089f56d64bcb0f557cfb26d.tar.gz |
fix ImmutableArray slices
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | lib/chef/node/mixin/state_tracking.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/node/mixin/state_tracking.rb b/lib/chef/node/mixin/state_tracking.rb index 469d4d300f..5958973024 100644 --- a/lib/chef/node/mixin/state_tracking.rb +++ b/lib/chef/node/mixin/state_tracking.rb @@ -34,14 +34,17 @@ class Chef @__precedence__ = precedence end - def [](key) + def [](*args) ret = super + key = args.first next_path = [ __path__, convert_key(key) ].flatten.compact copy_state_to(ret, next_path) end - def []=(key, value) + def []=(*args) ret = super + key = args.first + value = args.last next_path = [ __path__, convert_key(key) ].flatten.compact send_attribute_changed_event(next_path, value) copy_state_to(ret, next_path) |