]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commit
(MODULES-1341) Recover when deleting absent rules
authorReid Vandewiele <reid@puppetlabs.com>
Wed, 4 Nov 2015 18:40:20 +0000 (10:40 -0800)
committerReid Vandewiele <reid@puppetlabs.com>
Wed, 4 Nov 2015 18:40:20 +0000 (10:40 -0800)
commit8794c096102d41ada603450ec6e1e13e3c956506
tree9ce4601cb97a0b28c4c335d672f4236456b08b81
parent2d870c46e95850ff6ee8bda19f48381512be1af7
(MODULES-1341) Recover when deleting absent rules

Some types, specifically the resources type, will call Firewall
instances and then use generate to build and add to the catalog firewall
resources very early in a Puppet run. Later, those resources might be
removed as a side effect of another action, such as shutting down the
firewalld service.

Prior to this commit, Puppet would try to delete firewall resources
which were already absent, and throw an error. This commit adds an
exception catcher which will check to see if the rule being removed is
absent, and if so, consider the change a success even if the firewall
command failed. It will adjust the change message to reflect the
uncertainty over how the rule was removed, though it was verified
removed.
lib/puppet/provider/firewall/iptables.rb