mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-04 17:53:10 +00:00
Assume firewall is offline on DBUS_ERROR during init (#36486)
During init, the FirewallClient tries to connect to the DBUS socket. If it fails to connect it should be safe to assume firewalld is offline.
This commit is contained in:
@@ -164,6 +164,7 @@ try:
|
||||
from firewall.client import Rich_Rule
|
||||
from firewall.client import FirewallClient
|
||||
from firewall.client import FirewallClientZoneSettings
|
||||
from firewall.errors import FirewallError
|
||||
fw = None
|
||||
fw_offline = False
|
||||
import_failure = False
|
||||
@@ -171,7 +172,7 @@ try:
|
||||
try:
|
||||
fw = FirewallClient()
|
||||
fw.getDefaultZone()
|
||||
except AttributeError:
|
||||
except (AttributeError, FirewallError):
|
||||
# Firewalld is not currently running, permanent-only operations
|
||||
fw_offline = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user