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

(MODULES-10358) - Clarification added to Boolean validation checks #886

Merged
merged 1 commit into from
Jan 6, 2020
Merged
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
13 changes: 10 additions & 3 deletions lib/puppet/type/firewall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,13 @@ def should_to_s(value)
When combined with jump => "LOG" specifies the log prefix to use when
logging.
PUPPETCODE

munge do |value|
if value == ''
raise('log_prefix should not be an empty string')
end
value
end
end

newproperty(:log_uid, required_features: :log_uid) do
Expand Down Expand Up @@ -2303,7 +2310,7 @@ def should_to_s(value)
end
end

if value(:log_prefix) || value(:log_level) || value(:log_uid)
if value(:log_prefix) || value(:log_level) || value(:log_uid) == :true
unless value(:jump).to_s == 'LOG'
raise 'Parameter log_prefix, log_level and log_uid require jump => LOG'
end
Expand Down Expand Up @@ -2343,13 +2350,13 @@ def should_to_s(value)
raise "Parameter 'stat_probability' requires 'stat_mode' to be set to 'random'"
end

if value(:checksum_fill)
if value(:checksum_fill) == :true
unless value(:jump).to_s == 'CHECKSUM' && value(:table).to_s == 'mangle'
raise 'Parameter checksum_fill requires jump => CHECKSUM and table => mangle'
end
end

if value(:queue_num) || value(:queue_bypass)
if value(:queue_num) || value(:queue_bypass) == :true
unless value(:jump).to_s == 'NFQUEUE'
raise 'Paramter queue_number and queue_bypass require jump => NFQUEUE'
end
Expand Down