From e8c0ebd2483c0a4a060bedc043d301e1ebe2dcb7 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 8 Dec 2017 13:36:28 -0800 Subject: fix priority array order Signed-off-by: Lamont Granquist --- lib/chef/node_map.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/chef/node_map.rb b/lib/chef/node_map.rb index 5cc24b9d25..dde93a437d 100644 --- a/lib/chef/node_map.rb +++ b/lib/chef/node_map.rb @@ -33,6 +33,8 @@ # # note that as this examples show filter values may be a scalar string or an array of scalar strings. # +# XXX: confusingly, in the *_priority_map the :klass may be an array of Strings of class names +# class Chef class NodeMap @@ -218,10 +220,10 @@ class Chef # are exactly equal # XXX: remove this in Chef-14 and use last-writer-wins (prepend if they match) if !new_matcher[:override] + # we only sort classes, which only sorts the handler array, this magically does not sort + # the priority array via the invisible else here. if new_matcher[:klass].is_a?(Class) cmp = compare_matcher_properties(new_matcher[:klass].name, matcher[:klass].name) - else - cmp = compare_matcher_properties(new_matcher[:klass], matcher[:klass]) end end end -- cgit v1.2.1