puppetlabs-firewall
puppetlabs-firewall copied to clipboard
Fix rule parsing
Summary
This PR fixes a couple of issues, related to iptables-save output parsing:
- Double quotes in the comment breaks rule parsing (part after the first
"
will be ignored) - Rule parser thinks that custom chains with -A in the name (
NOMAD-ADMIN
, for example) is a start of the rule - Single quotes in the comments generates invalid
iptables-save
output that will then be processed by the rule parser. - For some parameters
iptables-save
return multiple spaces between flag and actual value (--nflog--prefix
)
Additional Context
I've added additional spec test that will be helpful with iptables-save
output parsing in the future.
Related Issues (if any)
#1182 #1170
Checklist
- [x] 🟢 Spec tests.
- [x] 🟢 Acceptance tests.
- [x] Manually verified. (For example
puppet apply
)