Exemple #1
0
    def addtmp(self, filename, fileinfo):
        logging.info('meta addtmp filename %s', filename)

        key = tmp_key(filename)
        ret = self.set(key, fileinfo)

        if ret == RET_SUCCESS:
            ret = self.expire(key, self.expire_time)

        return ret
Exemple #2
0
    def addtmp(self, filename, fileinfo):
        logging.info('meta addtmp filename %s', filename)

        key = tmp_key(filename)
        ret = self.set(key, fileinfo)

        if ret == RET_SUCCESS:
            ret = self.expire(key, self.expire_time)

        return ret
Exemple #3
0
 def gettmp(self, filename):
     logging.info('meta gettmp: file %s', filename)
     key = tmp_key(filename)
     return self.get(key)
Exemple #4
0
    def deltmp(self, filename):
        logging.info('meta deltmp: file %s', filename)
        key = tmp_key(filename)
        self.delete(key)

        return True
Exemple #5
0
 def hastmp(self, filename):
     logging.info('meta hastmp: file %s', filename)
     return self.exists(tmp_key(filename))
Exemple #6
0
 def gettmp(self, filename):
     logging.info('meta gettmp: file %s', filename)
     key = tmp_key(filename)
     return self.get(key)
Exemple #7
0
    def deltmp(self, filename):
        logging.info('meta deltmp: file %s', filename)
        key = tmp_key(filename)
        self.delete(key)

        return True
Exemple #8
0
 def hastmp(self, filename):
     logging.info('meta hastmp: file %s', filename)
     return self.exists(tmp_key(filename))
Exemple #9
0
def test_tmp_key():
    filename = '/testfile'
    key = tmp_key(filename)
    eq_(key, 'tmp:/testfile')