]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
cleanup flush and insert_order methods
authorJonathan Boyett <jonathan@failingservers.com>
Tue, 10 May 2011 22:30:46 +0000 (15:30 -0700)
committerJonathan Boyett <jonathan@failingservers.com>
Tue, 10 May 2011 22:30:46 +0000 (15:30 -0700)
lib/puppet/provider/firewall/iptables.rb

index 75d24da211e541d6170584ddb6cc5edf2d17de59..427eb0f0a183ee6e227c4b969e78337eb26e4383 100644 (file)
@@ -60,8 +60,7 @@ Puppet::Type.type(:firewall).provide :iptables, :parent => Puppet::Provider::Fir
   # Flush the property hash once done.
   def flush
     debug("[flush]")
-    needs_change = @property_hash.delete(:needs_change)
-    if needs_change
+    if @property_hash.delete(:needs_change)
       notice("Properties changed - updating rule")
       update
     end
@@ -143,8 +142,7 @@ Puppet::Type.type(:firewall).provide :iptables, :parent => Puppet::Provider::Fir
     
     # Find list of current rules based on chain
     self.class.instances.each do |rule|
-      next unless rule.chain == resource[:chain].to_s
-      rules << rule.name
+      rules << rule.name if rule.chain == resource[:chain].to_s
     end
 
     # No rules at all? Just bail now.