Browse Source

adjust ALFRED data parsing to newer format -.-

Helge Jung 8 years ago
parent
commit
6a83ba86e4
1 changed files with 10 additions and 0 deletions
  1. 10 0
      ffstatus/alfred.py

+ 10 - 0
ffstatus/alfred.py

@@ -100,6 +100,16 @@ class AlfredParser:
                 if 'mesh_interfaces' in nodestatic['network']:
                     macs = [x for x in nodestatic['network']['mesh_interfaces']]
                     nodeinfo['macs'] = macs
+                elif 'mesh' in nodestatic['network']:
+                    ifaces = nodestatic['network']['mesh']
+                    iftypes = [iftype for iftype in [ifaces[ifname]['interfaces'] for ifname in ifaces]]
+                    tmp = [x for x in iftypes]
+                    macs = []
+                    for x in tmp:
+                        for iftype in x:
+                            for mac in x[iftype]:
+                                macs.append(mac)
+                    nodeinfo['macs'] = macs
                 else:
                     nodeinfo['macs'] = []