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.
pull/36981/head
John Smith 7 years ago committed by Adam Miller
parent 83aaa8137a
commit 8824a8fe23

@ -164,6 +164,7 @@ try:
from firewall.client import Rich_Rule from firewall.client import Rich_Rule
from firewall.client import FirewallClient from firewall.client import FirewallClient
from firewall.client import FirewallClientZoneSettings from firewall.client import FirewallClientZoneSettings
from firewall.errors import FirewallError
fw = None fw = None
fw_offline = False fw_offline = False
import_failure = False import_failure = False
@ -171,7 +172,7 @@ try:
try: try:
fw = FirewallClient() fw = FirewallClient()
fw.getDefaultZone() fw.getDefaultZone()
except AttributeError: except (AttributeError, FirewallError):
# Firewalld is not currently running, permanent-only operations # Firewalld is not currently running, permanent-only operations
fw_offline = True fw_offline = True

Loading…
Cancel
Save