From 4336181c367f2c1aa79d62339afb858e0656432a Mon Sep 17 00:00:00 2001 From: Trey Dockendorf Date: Fri, 2 Feb 2024 12:06:37 -0500 Subject: [PATCH] Make permission sorting more dynamic --- lib/puppet/type/grafana_folder.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puppet/type/grafana_folder.rb b/lib/puppet/type/grafana_folder.rb index b56c3467..e1c40be4 100644 --- a/lib/puppet/type/grafana_folder.rb +++ b/lib/puppet/type/grafana_folder.rb @@ -52,8 +52,8 @@ def insync?(is) # Doing sort_by on array of values from each Hash was producing # inconsistent results where Puppet would think changes were necessary when # not actually necessary - is_m = is.map { |p| "#{p['role']}-#{p['teamId']}-#{p['permission']}" } - should_m = should.map { |p| "#{p['role']}-#{p['teamId']}-#{p['permission']}" } + is_m = is.map { |p| p.keys.sort.map { |k| p[k] }.join('-') } + should_m = should.map { |p| p.keys.sort.map { |k| p[k] }.join('-') } is_m.sort == should_m.sort end end