fix firwewalld permanent zone operations (#42868)

Fixes #42310

Previously, the firewalld module was making a call to
FirewallClientConfig.getZoneNames() which doesn't exist in versions
of firwalld older than 0.4.2, this patch implements the same logic
with older API calls to not require a newer version of firewalld.

Signed-off-by: Adam Miller <admiller@redhat.com>
pull/23659/merge
Adam Miller 6 years ago committed by ansibot
parent ffcdc53536
commit 231961564a

@ -498,7 +498,9 @@ class ZoneTransaction(FirewallTransaction):
self.module.fail_json(msg=self.tx_not_permanent_error_msg)
def get_enabled_permanent(self):
if self.zone in self.fw.config().getZoneNames():
zones = self.fw.config().listZones()
zone_names = [self.fw.config().getZone(z).get_property("name") for z in zones]
if self.zone in zone_names:
return True
else:
return False

Loading…
Cancel
Save