[mod] autopep8

This commit is contained in:
Laurent Peuch 2016-05-13 04:25:53 +02:00
parent fc5e37edc8
commit 088fc01b06

View file

@ -224,7 +224,7 @@ def firewall_reload(skip_upnp=False):
# Iterate over ports and add rule # Iterate over ports and add rule
for protocol in ['TCP', 'UDP']: for protocol in ['TCP', 'UDP']:
for port in firewall['ipv4'][protocol]: for port in firewall['ipv4'][protocol]:
rules.append("iptables -A INPUT -p %s --dport %s -j ACCEPT" \ rules.append("iptables -A INPUT -p %s --dport %s -j ACCEPT"
% (protocol, process.quote(str(port)))) % (protocol, process.quote(str(port))))
rules += [ rules += [
"iptables -A INPUT -i lo -j ACCEPT", "iptables -A INPUT -i lo -j ACCEPT",
@ -253,7 +253,7 @@ def firewall_reload(skip_upnp=False):
# Iterate over ports and add rule # Iterate over ports and add rule
for protocol in ['TCP', 'UDP']: for protocol in ['TCP', 'UDP']:
for port in firewall['ipv6'][protocol]: for port in firewall['ipv6'][protocol]:
rules.append("ip6tables -A INPUT -p %s --dport %s -j ACCEPT" \ rules.append("ip6tables -A INPUT -p %s --dport %s -j ACCEPT"
% (protocol, process.quote(str(port)))) % (protocol, process.quote(str(port))))
rules += [ rules += [
"ip6tables -A INPUT -i lo -j ACCEPT", "ip6tables -A INPUT -i lo -j ACCEPT",
@ -308,7 +308,8 @@ def firewall_upnp(action='status', no_refresh=False):
try: try:
# Remove old cron job # Remove old cron job
os.remove('/etc/cron.d/yunohost-firewall') os.remove('/etc/cron.d/yunohost-firewall')
except: pass except:
pass
action = 'status' action = 'status'
no_refresh = False no_refresh = False
@ -330,7 +331,8 @@ def firewall_upnp(action='status', no_refresh=False):
try: try:
# Remove cron job # Remove cron job
os.remove(upnp_cron_job) os.remove(upnp_cron_job)
except: pass except:
pass
enabled = False enabled = False
if action == 'status': if action == 'status':
no_refresh = True no_refresh = True
@ -364,7 +366,8 @@ def firewall_upnp(action='status', no_refresh=False):
if upnpc.getspecificportmapping(port, protocol): if upnpc.getspecificportmapping(port, protocol):
try: try:
upnpc.deleteportmapping(port, protocol) upnpc.deleteportmapping(port, protocol)
except: pass except:
pass
if not enabled: if not enabled:
continue continue
try: try: