mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
remove now unused 'changed' stuff
This commit is contained in:
parent
d354c75dbf
commit
33cb89918f
1 changed files with 2 additions and 8 deletions
|
@ -75,14 +75,11 @@ def firewall_allow(
|
||||||
"ipv6",
|
"ipv6",
|
||||||
]
|
]
|
||||||
|
|
||||||
changed = False
|
|
||||||
|
|
||||||
for p in protocols:
|
for p in protocols:
|
||||||
# Iterate over IP versions to add port
|
# Iterate over IP versions to add port
|
||||||
for i in ipvs:
|
for i in ipvs:
|
||||||
if port not in firewall[i][p]:
|
if port not in firewall[i][p]:
|
||||||
firewall[i][p].append(port)
|
firewall[i][p].append(port)
|
||||||
changed = True
|
|
||||||
else:
|
else:
|
||||||
ipv = "IPv%s" % i[3]
|
ipv = "IPv%s" % i[3]
|
||||||
logger.warning(m18n.n("port_already_opened", port=port, ip_version=ipv))
|
logger.warning(m18n.n("port_already_opened", port=port, ip_version=ipv))
|
||||||
|
@ -97,7 +94,7 @@ def firewall_allow(
|
||||||
|
|
||||||
# Update and reload firewall
|
# Update and reload firewall
|
||||||
_update_firewall_file(firewall)
|
_update_firewall_file(firewall)
|
||||||
if (not no_reload) or (changed):
|
if not no_reload:
|
||||||
return firewall_reload()
|
return firewall_reload()
|
||||||
|
|
||||||
|
|
||||||
|
@ -152,14 +149,11 @@ def firewall_disallow(
|
||||||
elif upnp_only:
|
elif upnp_only:
|
||||||
ipvs = []
|
ipvs = []
|
||||||
|
|
||||||
changed = False
|
|
||||||
|
|
||||||
for p in protocols:
|
for p in protocols:
|
||||||
# Iterate over IP versions to remove port
|
# Iterate over IP versions to remove port
|
||||||
for i in ipvs:
|
for i in ipvs:
|
||||||
if port in firewall[i][p]:
|
if port in firewall[i][p]:
|
||||||
firewall[i][p].remove(port)
|
firewall[i][p].remove(port)
|
||||||
changed = True
|
|
||||||
else:
|
else:
|
||||||
ipv = "IPv%s" % i[3]
|
ipv = "IPv%s" % i[3]
|
||||||
logger.warning(m18n.n("port_already_closed", port=port, ip_version=ipv))
|
logger.warning(m18n.n("port_already_closed", port=port, ip_version=ipv))
|
||||||
|
@ -172,7 +166,7 @@ def firewall_disallow(
|
||||||
|
|
||||||
# Update and reload firewall
|
# Update and reload firewall
|
||||||
_update_firewall_file(firewall)
|
_update_firewall_file(firewall)
|
||||||
if (not no_reload) or (changed):
|
if not no_reload:
|
||||||
return firewall_reload()
|
return firewall_reload()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue