Fix indentation

This commit is contained in:
titoko 2012-12-18 00:40:13 +01:00
parent ad223a6373
commit 993815181d

View file

@ -25,17 +25,17 @@ def firewall_allow(protocol=None,port=None,ipv6=None):
Dict Dict
""" """
if int(port)<65536 and int(port)>0: if int(port)<65536 and int(port)>0:
if protocol == "Both": if protocol == "Both":
update_yml(port,'tcp','a',ipv6) update_yml(port,'tcp','a',ipv6)
update_yml(port,'udp','a',ipv6) update_yml(port,'udp','a',ipv6)
else: else:
update_yml(port,protocol,'a',ipv6) update_yml(port,protocol,'a',ipv6)
win_msg(_("Port successfully openned")) win_msg(_("Port successfully openned"))
else: else:
raise YunoHostError(22,_("Port not between 1 and 65535 : ")+port) raise YunoHostError(22,_("Port not between 1 and 65535 : ")+port)
@ -140,7 +140,6 @@ def firewall_reload():
def update_yml(port=None,protocol=None,mode=None,ipv6=None): def update_yml(port=None,protocol=None,mode=None,ipv6=None):
""" """
Update firewall.yml Update firewall.yml
Keyword arguments: Keyword arguments:
protocol -- Protocol used protocol -- Protocol used
port -- Port to open port -- Port to open
@ -149,7 +148,6 @@ def update_yml(port=None,protocol=None,mode=None,ipv6=None):
Return Return
None None
""" """
if ipv6: if ipv6:
ip = 'ipv6' ip = 'ipv6'
@ -179,6 +177,3 @@ def update_yml(port=None,protocol=None,mode=None,ipv6=None):
with open('firewall.yml','w') as f: with open('firewall.yml','w') as f:
yaml.dump(firewall,f) yaml.dump(firewall,f)