Skip to content

Commit

Permalink
(MODULES-10358) - Clarification added to Boolean validation checks
Browse files Browse the repository at this point in the history
  • Loading branch information
David Swan committed Jan 2, 2020
1 parent 5aaedbf commit bf7cf1b
Showing 1 changed file with 10 additions and 3 deletions.
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

0 comments on commit bf7cf1b

Please sign in to comment.