]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commit
[MODULES-5924] Fix unmanaged rule regex when updating a iptable.
authorSofer Athlan-Guyot <chem@sathlan.org>
Fri, 3 Nov 2017 12:42:31 +0000 (13:42 +0100)
committerSofer Athlan-Guyot <chem@sathlan.org>
Fri, 3 Nov 2017 12:42:31 +0000 (13:42 +0100)
commitc7ce161ecd04ff088f8eb0f8e7a8c3df413db045
treeab604caecf74dee0209de5416fb72b20f280b3d8
parent7f8b3aaea13c2d21b1b8472e2ae2aef12688742f
[MODULES-5924] Fix unmanaged rule regex when updating a iptable.

We have two kind of unmanaged rules:

- empty comment: those get an md5 hash as a name prefixed with 90XX
- comment not matching “\d[graph,space]+$”

This is defined there[1]

But when we calculate the updated line we take into account only the
first kind of unmanaged rule in the offset[2] which leads to error.

Relaxing the regex solves this.

[1] https://github.com/puppetlabs/puppetlabs-firewall/blob/master/lib/puppet/provider/firewall/iptables.rb#L610..L617
[2] https://github.com/puppetlabs/puppetlabs-firewall/blob/master/lib/puppet/provider/firewall/iptables.rb#L802..L803
lib/puppet/provider/firewall/iptables.rb