Browse Source

batman: don't skip "first" gateway

Helge Jung 9 years ago
parent
commit
58a02b3e9b
1 changed files with 3 additions and 1 deletions
  1. 3 1
      ffstatus/batman.py

+ 3 - 1
ffstatus/batman.py

@@ -72,10 +72,12 @@ class BatmanParser:
         # call 'batctl gwl' and parse output lines
         rawgwdata = subprocess.check_output([self.batctl, 'gwl'])
         gateways = []
-        for l in rawgwdata.splitlines()[2:]:
+        for l in rawgwdata.splitlines()[1:]:
             m = re.search("^\s*(([a-fA-F0-9]{2}:){5}[a-fA-F0-9]{2})\s+", l)
             if m is not None:
                 gateways.append(ffstatus.mac2id(m.group(1)))
+            else:
+                print('Failed to parse gateway from batctl-gwl line:', l)
 
         # call batadv-vis and parse output as unicode JSON
         rawdata = subprocess.check_output([self.batadv_vis, '-f', 'jsondoc'])