(self, oid, files, metrics)
Reads values from owfs/oid/{files} and update
        metrics with format [oid.alias] = value
Reads values from owfs/oid/{files} and update
        metrics with format [oid.alias] = value
Reads values from owfs / oid / { files } and update metrics with format [ oid . alias ] = value
def read_values(self, oid, files, metrics):
        """
        Reads values from owfs/oid/{files} and update
        metrics with format [oid.alias] = value
        """

        oid_path = os.path.join(self.config['owfs'], oid)
        oid = oid.replace('.', '_')

        for fn, alias in files.iteritems():
            fv = os.path.join(oid_path, fn)
            if os.path.isfile(fv):
                try:
                    f = open(fv)
                    v = f.read()
                    f.close()
                except:
                    self.log.error("Unable to read %s", fv)
                    raise

                try:
                    v = float(v)
                except:
                    self.log.error("Unexpected value %s in %s", v, fv)
                    raise

                metrics["%s.%s" % (oid, alias)] = v
def read_values ( self , oid , files , metrics ) : oid_path = os . path . join ( self . config [ 'owfs' ] , oid ) oid = oid . replace ( '.' , '_' ) for fn , alias in files . iteritems ( ) : fv = os . path . join ( oid_path , fn ) if os . path . isfile ( fv ) : try : f = open ( fv ) v = f . read ( ) f . close ( ) except : self . log . error ( "Unable to read %s" , fv ) raise try : v = float ( v ) except : self . log . error ( "Unexpected value %s in %s" , v , fv ) raise metrics [ "%s.%s" % ( oid , alias ) ] = v