Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single element ipset array should be in sync with its string equivalent #1208

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lib/puppet/provider/firewall/firewall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ def insync?(context, _name, property_name, is_hash, should_hash)
should = should_hash[property_name].to_s.gsub(%r{\s+}, '')

is == should
when :ipset
is = is_hash[property_name]
is = [is] if is.is_a?(String)
should = should_hash[property_name]
should = [should] if should.is_a?(String)
is.sort == should.sort
else
# Ensure that if both values are arrays, that they are sorted prior to comparison
return nil unless is_hash[property_name].is_a?(Array) && should_hash[property_name].is_a?(Array)
Expand Down
Loading