← Back to team overview

graphite-dev team mailing list archive

Re: [Question #141393]: KeyError 'ds' when reading imported RRDs

 

Question #141393 on Graphite changed:
https://answers.launchpad.net/graphite/+question/141393

    Status: Open => Answered

chrismd proposed the following answer:
Hm... I'm not sure what the correct usage of the new python-rrdtool API
is, the docs on rrdtool.org aren't very clear. I don't have rrdtool
installed to test right this minute but give this a try:

Replace the contents of the try block, which in the snippet you showed
is:

      info = rrdtool.info(self.fs_path)
      return [RRDDataSource(self, source) for source in info['ds']]


With this:

      info = rrdtool.info(self.fs_path)
      if 'ds' in info:
        return [RRDDataSource(self, source) for source in info['ds']]
      else:
        datasources = set([ key.split('.')[0] for key in info if key.startswith('ds[') ])
        return [RRDDataSource(self, source) for source in datasources]


Let me know if that works.

-- 
You received this question notification because you are a member of
graphite-dev, which is an answer contact for Graphite.