Skip to content

Commit

Permalink
clean up whitespace and use single-quoted strings
Browse files Browse the repository at this point in the history
  • Loading branch information
haught committed Nov 8, 2019
1 parent 47af7d0 commit c784bea
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/puppet/provider/firewall/ip6tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def self.iptables_save(*args)
addrtype: [:src_type, :dst_type],
iprange: [:src_range, :dst_range],
owner: [:uid, :gid],
conntrack: [:ctstate, :ctproto, :ctorigsrc, :ctorigdst, :ctreplsrc, :ctrepldst,
conntrack: [:ctstate, :ctproto, :ctorigsrc, :ctorigdst, :ctreplsrc, :ctrepldst,
:ctorigsrcport, :ctorigdstport, :ctreplsrcport, :ctrepldstport, :ctstatus, :ctexpire, :ctdir],
time: [:time_start, :time_stop, :month_days, :week_days, :date_start, :date_stop, :time_contiguous, :kernel_timezone],
geoip: [:src_cc, :dst_cc],
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/firewall/iptables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
addrtype: [:src_type, :dst_type],
iprange: [:src_range, :dst_range],
owner: [:uid, :gid],
conntrack: [:ctstate, :ctproto, :ctorigsrc, :ctorigdst, :ctreplsrc, :ctrepldst,
conntrack: [:ctstate, :ctproto, :ctorigsrc, :ctorigdst, :ctreplsrc, :ctrepldst,
:ctorigsrcport, :ctorigdstport, :ctreplsrcport, :ctrepldstport, :ctstatus, :ctexpire, :ctdir],
time: [:time_start, :time_stop, :month_days, :week_days, :date_start, :date_stop, :time_contiguous, :kernel_timezone],
geoip: [:src_cc, :dst_cc],
Expand Down
30 changes: 15 additions & 15 deletions lib/puppet/type/firewall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,7 @@ def should_to_s(value)

newproperty(:ctproto, required_features: :conntrack) do
desc <<-PUPPETCODE
The specific layer-4 protocol number to match for this rule using the
The specific layer-4 protocol number to match for this rule using the
conntrack module.
PUPPETCODE
newvalue(%r{^!?\s?\d+$})
Expand Down Expand Up @@ -979,9 +979,9 @@ def should_to_s(value)
begin
@resource.host_to_mask(value, protocol)
if protocol == :IPv4
value.chomp("/32")
value.chomp('/32')
elsif protocol == :IPv6
value.chomp("/128")
value.chomp('/128')
end
rescue StandardError => e
raise("host_to_ip failed for #{value}, exception #{e}")
Expand Down Expand Up @@ -1015,9 +1015,9 @@ def should_to_s(value)
begin
@resource.host_to_mask(value, protocol)
if protocol == :IPv4
value.chomp("/32")
value.chomp('/32')
elsif protocol == :IPv6
value.chomp("/128")
value.chomp('/128')
end
rescue StandardError => e
raise("host_to_ip failed for #{value}, exception #{e}")
Expand Down Expand Up @@ -1051,9 +1051,9 @@ def should_to_s(value)
begin
@resource.host_to_mask(value, protocol)
if protocol == :IPv4
value.chomp("/32")
value.chomp('/32')
elsif protocol == :IPv6
value.chomp("/128")
value.chomp('/128')
end
rescue StandardError => e
raise("host_to_ip failed for #{value}, exception #{e}")
Expand Down Expand Up @@ -1087,9 +1087,9 @@ def should_to_s(value)
begin
@resource.host_to_mask(value, protocol)
if protocol == :IPv4
value.chomp("/32")
value.chomp('/32')
elsif protocol == :IPv6
value.chomp("/128")
value.chomp('/128')
end
rescue StandardError => e
raise("host_to_ip failed for #{value}, exception #{e}")
Expand All @@ -1099,7 +1099,7 @@ def should_to_s(value)

newproperty(:ctorigsrcport, required_features: :conntrack) do
desc <<-PUPPETCODE
The original source port to match for this filter using the conntrack module.
The original source port to match for this filter using the conntrack module.
For example:
ctorigsrcport => '80'
Expand All @@ -1118,7 +1118,7 @@ def should_to_s(value)

newproperty(:ctorigdstport, required_features: :conntrack) do
desc <<-PUPPETCODE
The original destination port to match for this filter using the conntrack module.
The original destination port to match for this filter using the conntrack module.
For example:
ctorigdstport => '80'
Expand All @@ -1137,7 +1137,7 @@ def should_to_s(value)

newproperty(:ctreplsrcport, required_features: :conntrack) do
desc <<-PUPPETCODE
The reply source port to match for this filter using the conntrack module.
The reply source port to match for this filter using the conntrack module.
For example:
ctreplsrcport => '80'
Expand All @@ -1156,7 +1156,7 @@ def should_to_s(value)

newproperty(:ctrepldstport, required_features: :conntrack) do
desc <<-PUPPETCODE
The reply destination port to match for this filter using the conntrack module.
The reply destination port to match for this filter using the conntrack module.
For example:
ctrepldstport => '80'
Expand Down Expand Up @@ -1214,8 +1214,8 @@ def should_to_s(value)

newproperty(:ctdir, required_features: :conntrack) do
desc <<-PUPPETCODE
Matches a packet that is flowing in the specified direction using the
conntrack module. If this flag is not specified at all, matches packets
Matches a packet that is flowing in the specified direction using the
conntrack module. If this flag is not specified at all, matches packets
in both directions. Values can be:
* REPLY
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/puppet/type/firewall_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@
describe ':ctproto' do
it 'accepts numeric value' do
resource[:ctproto] = 6
expect(resource[:ctproto]).to eql 6
expect(resource[:ctproto]).to be 6
end
it 'accepts negated string value' do
resource[:ctproto] = '! 6'
Expand Down Expand Up @@ -480,7 +480,7 @@
describe port do
it "should accept #{port} as numeric value" do
resource[port] = 80
expect(resource[port]).to eql 80
expect(resource[port]).to be 80
end
it "should accept #{port} as range value" do
resource[port] = '80:81'
Expand Down Expand Up @@ -517,7 +517,7 @@
describe ':ctexpire' do
it 'accepts numeric values' do
resource[:ctexpire] = 100
expect(resource[:ctexpire]).to eql 100
expect(resource[:ctexpire]).to be 100
end

it 'accepts numeric range values' do
Expand Down

0 comments on commit c784bea

Please sign in to comment.