Permalink
Browse files

Merge pull request #69 from kbarber/ticket/10619-Unable_to_purge_rules

* (#10619) Add the table when deleting rules
* (#10619) Fix tests since we are now prefixing -t <table> during delete
* Fix extraneous trailing whitespace
  • Loading branch information...
2 parents d7ab4c5 + 01f1462 commit 809c9f75b19312bf0549c3cb8c9e09575441f884 @dcarley dcarley committed Mar 26, 2012
Showing with 8 additions and 5 deletions.
  1. +2 −0 lib/puppet/provider/firewall/iptables.rb
  2. +6 −5 spec/unit/puppet/provider/iptables_spec.rb
@@ -213,6 +213,8 @@ def delete_args
end
end
+ line.unshift("-t", properties[:table])
+
# Return array without nils
line.compact
end
@@ -34,12 +34,12 @@
end
it "should raise a default provider error when there are no commands" do
- # Stub all commands lookups so they return nothing
+ # Stub all commands lookups so they return nothing
exists.any_instance.stubs(:which).returns false
# Instantiate a resource instance and make sure it raises an exception
- lambda { resource = Puppet::Type.type(:firewall).new({
- :name => '000 test foo' }) }.should raise_error(Puppet::DevError,
+ lambda { resource = Puppet::Type.type(:firewall).new({
+ :name => '000 test foo' }) }.should raise_error(Puppet::DevError,
"Could not find a default provider for firewall")
end
end
@@ -57,7 +57,7 @@
Puppet::Type::Firewall.stubs(:defaultprovider).returns provider
provider.stubs(:command).with(:iptables_save).returns "/sbin/iptables-save"
end
-
+
it 'should be able to get a list of existing rules' do
# Pretend to return nil from iptables
provider.expects(:execute).with(['/sbin/iptables-save']).returns("")
@@ -159,7 +159,8 @@
end
it 'delete_args is the same as the rule string when joined' do
- instance.delete_args.join(' ').should == sample_rule.gsub(/\-A/, '-D')
+ instance.delete_args.join(' ').should == sample_rule.gsub(/\-A/,
+ '-t filter -D')
end
end
end

0 comments on commit 809c9f7

Please sign in to comment.