summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-11-14 10:27:30 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2016-11-14 10:27:30 -0800
commit7524f955aea038b45089f56d64bcb0f557cfb26d (patch)
tree753801e9951676889d2344c804ec1ed21a4f2d02
parented93e0fb1644643cb0d064776b3283401dfba9a7 (diff)
downloadchef-7524f955aea038b45089f56d64bcb0f557cfb26d.tar.gz
fix ImmutableArray slices
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/node/mixin/state_tracking.rb7
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)