Revision 9d4502a8 snf-pithos-backend/pithos/backends/lib/sqlalchemy/node.py

b/snf-pithos-backend/pithos/backends/lib/sqlalchemy/node.py
330 330
        self.statistics_update(parent, -nr, size, mtime, cluster)
331 331
        self.statistics_update_ancestors(parent, -nr, size, mtime, cluster)
332 332

  
333
        s = select([self.versions.c.hash])
333
        s = select([self.versions.c.hash, self.versions.c.serial])
334 334
        s = s.where(where_clause)
335 335
        r = self.conn.execute(s)
336
        hashes = [row[0] for row in r.fetchall()]
336
        hashes = []
337
        serials = []
338
        for row in r.fetchall():
339
            hashes += [row[0]]
340
            serials += [row[1]]
337 341
        r.close()
338 342

  
339 343
        #delete versions
......
352 356
        s = self.nodes.delete().where(self.nodes.c.node.in_(nodes))
353 357
        self.conn.execute(s).close()
354 358

  
355
        return hashes, size
359
        return hashes, size, serials
356 360

  
357 361
    def node_purge(self, node, before=inf, cluster=0):
358 362
        """Delete all versions with the specified
......
378 382
        mtime = time()
379 383
        self.statistics_update_ancestors(node, -nr, -size, mtime, cluster)
380 384

  
381
        s = select([self.versions.c.hash])
385
        s = select([self.versions.c.hash, self.versions.c.serial])
382 386
        s = s.where(where_clause)
383 387
        r = self.conn.execute(s)
384
        hashes = [r[0] for r in r.fetchall()]
388
        hashes = []
389
        serials = []
390
        for row in r.fetchall():
391
            hashes += [row[0]]
392
            serials += [row[1]]
385 393
        r.close()
386 394

  
387 395
        #delete versions
......
400 408
        s = self.nodes.delete().where(self.nodes.c.node.in_(nodes))
401 409
        self.conn.execute(s).close()
402 410

  
403
        return hashes, size
411
        return hashes, size, serials
404 412

  
405 413
    def node_remove(self, node):
406 414
        """Remove the node specified.

Also available in: Unified diff