decode_network_values dstype is ordinal value of string literal
authorAlexander Else <alexander.else@team.telstra.com>
Mon, 1 Jul 2013 06:17:12 +0000 (16:17 +1000)
committerAlexander Else <alexander.else@team.telstra.com>
Mon, 1 Jul 2013 06:17:12 +0000 (16:17 +1000)
contrib/collectd_network.py

index 9af0fb0..dc6cdac 100644 (file)
@@ -76,7 +76,7 @@ def decode_network_values(ptype, plen, buf):
     assert double.size == number.size
 
     result = []
-    for dstype in buf[header.size+short.size:off]:
+    for dstype in [ord(x) for x in buf[header.size+short.size:off]]:
         if dstype == DS_TYPE_COUNTER:
             result.append((dstype, number.unpack_from(buf, off)[0]))
             off += valskip