Explorar o código

Compute missing information from cjdns.InterfaceController_peerStats (removed in a previous update?)

Valentin Lorentz %!s(int64=7) %!d(string=hai) anos
pai
achega
f06be14cd2
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      contrib/python/cjdnsadmin/adminTools.py

+ 4 - 0
contrib/python/cjdnsadmin/adminTools.py

@@ -96,6 +96,10 @@ def peerStats(cjdns,up=False,verbose=False,human_readable=False):
         ps = cjdns.InterfaceController_peerStats(i);
         peers = ps['peers']
         for p in peers:
+            tokens = p['addr'].split('.', 5)
+            p['version'] = tokens[0].strip('v')
+            p['switchLabel'] = '.'.join(tokens[1:5])
+            p['publicKey'] = tokens[5]
             if p['state'] == 'UNRESPONSIVE' and up:
                 continue
             allPeers.append(p)