Skip to content

Commit

Permalink
Ensure stable key order when processing hashes
Browse files Browse the repository at this point in the history
Even though it might just be possible to create a stable
insertion order in other places, this should really
not be necessary. We want to generate stable icinga
config files without having to jump though any extra hoops.
  • Loading branch information
Heinz-Daniel Krämer committed Feb 6, 2025
1 parent a00f513 commit d3fccbc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet_x/icinga2/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def self.process_array(items, indent = 2)

def self.process_hash(attrs, indent = 2, level = 3, prefix = ' ' * indent)
result = ''
attrs.each do |attr, value_frozen|
attrs.sort.each do |attr, value_frozen|
value = value_frozen.dup
if value.is_a?(Puppet::Pops::Types::PSensitiveType::Sensitive)
value = value.unwrap
Expand Down

0 comments on commit d3fccbc

Please sign in to comment.