Skip to content

Commit

Permalink
same for deprovisionning: reload once
Browse files Browse the repository at this point in the history
  • Loading branch information
OniriCorpe committed May 20, 2024
1 parent 832b9d3 commit d70f5ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/utils/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,9 @@ def provision_or_update(self, context: Dict = {}):
firewall_reload()

def deprovision(self, context: Dict = {}):
from yunohost.firewall import firewall_disallow
from yunohost.firewall import firewall_disallow, firewall_list, firewall_reload

previous_ports = firewall_list(raw=True)

for name, infos in self.ports.items():
setting_name = f"port_{name}" if name != "main" else "port"
Expand All @@ -1352,6 +1354,9 @@ def deprovision(self, context: Dict = {}):
infos["exposed"], int(value), reload_only_if_change=True
)

if firewall_list(raw=True) != previous_ports:
firewall_reload()


class DatabaseAppResource(AppResource):
"""
Expand Down

0 comments on commit d70f5ac

Please sign in to comment.