summaryrefslogtreecommitdiffstats
path: root/files/xml.py
diff options
context:
space:
mode:
Diffstat (limited to 'files/xml.py')
-rw-r--r--files/xml.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/files/xml.py b/files/xml.py
index c072819..b75906f 100644
--- a/files/xml.py
+++ b/files/xml.py
@@ -97,8 +97,11 @@ if args.mode == 'connected':
store = {}
peers = args.peers
- for i in root.findall('.//peerStatus'):
- p = i.find('peer')
+ l = root.findall('.//peerStatus')
+ if len(l) != 1:
+ sys.exit(3)
+
+ for p in l[0].findall('.//peer'):
h = p.find('hostname').text
c = (str(p.find('connected').text) == '1') # connected...?
s = (str(p.find('state').text) in VALID_PEERED) # valid peering