Make RRD key names accessible as a list
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Dec 2015 22:01:46 +0000 (23:01 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Dec 2015 22:01:46 +0000 (23:01 +0100)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/collecty/plugins/base.py

index b6eabd0..dd7f0d9 100644 (file)
@@ -440,12 +440,20 @@ class Object(object):
 
                return schema
 
-       def make_rrd_defs(self, prefix=None):
-               defs = []
+       @property
+       def rrd_schema_names(self):
+               ret = []
 
                for line in self.rrd_schema:
-                       (def_type, name, type, lower_limit, upper_limit) = line.split(":")
+                       (prefix, name, type, lower_limit, upper_limit) = line.split(":")
+                       ret.append(name)
+
+               return ret
+
+       def make_rrd_defs(self, prefix=None):
+               defs = []
 
+               for name in self.rrd_schema_names:
                        if prefix:
                                p = "%s_%s" % (prefix, name)
                        else: