Code

decode_network_values dstype is ordinal value of string literal
[collectd.git] / contrib / collectd_network.py
index 0a5d57e6cfe6030eec55df16fecb28b45a828c66..dc6cdac4f997fecbaf2d68d5548195aa302dcfed 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Copyright © 2009 Adrian Perez <aperez@igalia.com>
 #
-# Distributed under terms of the GPLv2 license.
+# Distributed under terms of the GPLv2 license or newer.
 # 
 # Frank Marien (frank@apsu.be) 6 Sep 2012
 # - quick fixes for 5.1 binary protocol
@@ -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