]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commit
Bugfix: Account for rules sorted after unmanaged rules
authorHunter Haugen <hunter@puppetlabs.com>
Wed, 19 Feb 2014 23:32:24 +0000 (15:32 -0800)
committerHunter Haugen <hunter@puppetlabs.com>
Thu, 20 Feb 2014 18:34:27 +0000 (10:34 -0800)
commitd3371067a1de04421cade988782cf0274c9a9fc5
tree66a2a1a053d247cd6d3238d9f5754cf13e2aa902
parent1249faaa21b42ed5c5fbb0eb921f6b76c5f82f7e
Bugfix: Account for rules sorted after unmanaged rules

The offset calculation assumed unmanaged rules are numbered 9000+ and
would be sorted to the end and didn't need to be accounted for. This
caused failures when people used9-numbered rules. This should fix that.

Additionally, for rules that are 9-numbered, they should be ordered
*after* unmanaged rules, so this fixes that too.

So when encountering unmanaged rules, the order will be something like
this:

- Managed rules that begin with 0 through 8
- Unmanaged rules (which are assigned 9-numbers)
- Managed rules that begin with 9 (but not numbered lower than the
  unmanaged rules)

Mixing unmanaged rules with managed rules is still not officially
supported, but at least we can try and behave with them.
lib/puppet/provider/firewall/iptables.rb
spec/unit/puppet/provider/iptables_spec.rb