Skip to content

Commit 2bd5bc6

Browse files
committed
s-c-p doesn't react on ALREADY_ENABLED firewalld exception
1 parent e19272f commit 2bd5bc6

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@
2323
- Addition of some strings for i18n (https://github.com/zdohnal/system-config-printer/pull/81)
2424
- Update .po and .pot files
2525
- added GenericName and X-GNOME-FullName to system-config-printer.desktop.in (https://github.com/zdohnal/system-config-printer/issues/20)
26+
- removed some deprecated parts of gui
27+
- updated translations by files from Zanata
28+
- s-c-p doesn't react on ALREADY_ENABLED exception from firewalld

firewallsettings.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ def add_service (self, service):
118118
if not self._get_fw_data ():
119119
return
120120

121-
self._fw_data.addService (service)
121+
from firewall.errors import FirewallError
122+
import firewall.errors
123+
try:
124+
self._fw_data.addService (service)
125+
except FirewallError as e:
126+
if e.code is firewall.errors.ALREADY_ENABLED:
127+
pass
122128

123129
def check_ipp_client_allowed (self):
124130
if not self._get_fw_data ():

0 commit comments

Comments
 (0)