Update yunohost_firewall.py

Better display for firewall_list()
This commit is contained in:
titoko 2012-12-12 13:59:20 +01:00 committed by Titoko
parent 9f1e6adf26
commit 1522a7f759

View file

@ -42,8 +42,16 @@ def firewall_list():
Parse and display firwall.yml
'''
with open ('firewall.yml') as f:
firewall = yaml.load(f)
print(firewall)
firewall = yaml.load(f)
listPortTCP=firewall['ipv4']['TCP']
listPortUDP=firewall['ipv4']['UDP']
print("Port TCP OPEN :")
for i,port in enumerate (listPortTCP):
print("-"+str(port))
print("Port UDP OPEN :")
for i,port in enumerate (listPortUDP):
print("-"+str(port))
f.close()
def firewall_reload():
'''