Skip to content

Commit

Permalink
Make permission sorting more dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
treydock committed Feb 2, 2024
1 parent b227484 commit 4336181
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/type/grafana_folder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4336181

Please sign in to comment.