Skip to content

Commit ff5489c

Browse files
committed
check if ipp service is enabled before the call
1 parent 2bd5bc6 commit ff5489c

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

firewallsettings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ def add_service (self, service):
125125
except FirewallError as e:
126126
if e.code is firewall.errors.ALREADY_ENABLED:
127127
pass
128+
else:
129+
raise FirewallError (e.code, e.msg)
128130

129131
def check_ipp_client_allowed (self):
130132
if not self._get_fw_data ():

newprinter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2306,7 +2306,9 @@ def on_firewall_read (self, data):
23062306
def adjust_firewall_response (self, dialog, response):
23072307
dialog.destroy ()
23082308
if response == Gtk.ResponseType.YES:
2309-
self.firewall.add_service (firewallsettings.IPP_SERVER_SERVICE)
2309+
ipp_server_allowed = self.firewall.check_ipp_server_allowed ()
2310+
if not ipp_server_allowed:
2311+
self.firewall.add_service (firewallsettings.IPP_SERVER_SERVICE)
23102312
self.firewall.write ()
23112313

23122314
debugprint ("Fetching network devices after firewall dialog response")

0 commit comments

Comments
 (0)