]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
clean up whitespace and use single-quoted strings
authorMatt Haught <dmhaught@ncsu.edu>
Fri, 8 Nov 2019 06:47:08 +0000 (01:47 -0500)
committerMatt Haught <dmhaught@ncsu.edu>
Fri, 8 Nov 2019 06:47:08 +0000 (01:47 -0500)
lib/puppet/provider/firewall/ip6tables.rb
lib/puppet/provider/firewall/iptables.rb
lib/puppet/type/firewall.rb
spec/unit/puppet/type/firewall_spec.rb

index 85f77df0544a7b4d985cb48969362f526ea69c1d..103773f9c39ed97bca0ed9818085ffc73b0fe8d4 100644 (file)
@@ -220,7 +220,7 @@ Puppet::Type.type(:firewall).provide :ip6tables, parent: :iptables, source: :ip6
     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],
index 30a16712b3ed761ff5ff88ff3b7ff75d1787ee34..c1cba9deb0e57fde24dacb9f8e23ac2ace564c73 100644 (file)
@@ -227,7 +227,7 @@ Puppet::Type.type(:firewall).provide :iptables, parent: Puppet::Provider::Firewa
     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],
index 9beb4a702816894e41f4f7d326284236da81064e..cba598c95bf3f3c43464a3495eb17c8616086eb8 100644 (file)
@@ -947,7 +947,7 @@ Puppet::Type.newtype(:firewall) do
 
   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+$})
@@ -979,9 +979,9 @@ Puppet::Type.newtype(:firewall) do
       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}")
@@ -1015,9 +1015,9 @@ Puppet::Type.newtype(:firewall) do
       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}")
@@ -1051,9 +1051,9 @@ Puppet::Type.newtype(:firewall) do
       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}")
@@ -1087,9 +1087,9 @@ Puppet::Type.newtype(:firewall) do
       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}")
@@ -1099,7 +1099,7 @@ Puppet::Type.newtype(:firewall) do
 
   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'
@@ -1118,7 +1118,7 @@ Puppet::Type.newtype(:firewall) do
 
   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'
@@ -1137,7 +1137,7 @@ Puppet::Type.newtype(:firewall) do
 
   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'
@@ -1156,7 +1156,7 @@ Puppet::Type.newtype(:firewall) do
 
   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'
@@ -1214,8 +1214,8 @@ Puppet::Type.newtype(:firewall) do
 
   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
index 8897b32461667f33205f6e7a7e7eadcd3c5374cc..fbe65ebcb7f2f1499253dcc6876a7f11eda3c370 100755 (executable)
@@ -439,7 +439,7 @@ describe firewall do # rubocop:disable RSpec/MultipleDescribes
   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'
@@ -480,7 +480,7 @@ describe firewall do # rubocop:disable RSpec/MultipleDescribes
     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'
@@ -517,7 +517,7 @@ describe firewall do # rubocop:disable RSpec/MultipleDescribes
   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