Skip to content

Commit 9556945

Browse files
fix: Compare bindings using sets for order independence
Convert 'is' and 'should' binding arrays to sets before comparison to ensure that the order of bindings does not affect equality checks. This prevents false negatives when bindings are identical but ordered differently.
1 parent 3998da2 commit 9556945

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/puppet/type/iis_site.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ def should=(values)
166166
end
167167

168168
def insync?(is)
169-
PuppetX::PuppetLabs::IIS::Bindings.sort_bindings(is) == should
169+
#Convert bindings to set of hashes for unordered comparison
170+
is_set = is.to_set
171+
should_set = should.to_set
172+
173+
#Compare the sets
174+
is_set = should_set
170175
end
171176
end
172177

0 commit comments

Comments
 (0)