From 1522a7f75931dceecd06a6fc5095692f218d4ec5 Mon Sep 17 00:00:00 2001 From: titoko Date: Wed, 12 Dec 2012 13:59:20 +0100 Subject: [PATCH] Update yunohost_firewall.py Better display for firewall_list() --- yunohost_firewall.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/yunohost_firewall.py b/yunohost_firewall.py index 9c1969b0..138a901c 100644 --- a/yunohost_firewall.py +++ b/yunohost_firewall.py @@ -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(): '''