Revision 0a92ff85 snf-pithos-backend/pithos/backends/modular.py

b/snf-pithos-backend/pithos/backends/modular.py
538 538
            for h in hashes:
539 539
                self.store.map_delete(h)
540 540
            self.node.node_purge_children(node, until, CLUSTER_DELETED)
541
            self._report_size_change(user, account, -size,
542
                                     {'action':'container purge', 'path': path,
543
                                      'versions': ','.join(str(i) for i in serials)})
541
            if not self.free_versioning:
542
                self._report_size_change(
543
                    user, account, -size, {
544
                        'action':'container purge',
545
                        'path': path,
546
                        'versions': ','.join(str(i) for i in serials)
547
                    }
548
                )
544 549
            return
545 550

  
546 551
        if not delimiter:
......
552 557
                self.store.map_delete(h)
553 558
            self.node.node_purge_children(node, inf, CLUSTER_DELETED)
554 559
            self.node.node_remove(node)
555
            self._report_size_change(user, account, -size,
556
                                     {'action': 'container delete',
557
                                      'path': path,
558
                                      'versions': ','.join(str(i) for i in serials)})
560
            if not self.free_versioning:
561
                self._report_size_change(
562
                    user, account, -size, {
563
                        'action':'container purge',
564
                        'path': path,
565
                        'versions': ','.join(str(i) for i in serials)
566
                    }
567
                )
559 568
        else:
560 569
            # remove only contents
561 570
            src_names = self._list_objects_no_limit(user, account, container, prefix='', delimiter=None, virtual=False, domain=None, keys=[], shared=False, until=None, size_range=None, all_props=True, public=False)
......
995 1004
            serials += v
996 1005
            h, s, v = self.node.node_purge(node, until, CLUSTER_HISTORY)
997 1006
            hashes += h
998
            size += s
1007
            if not self.free_versioning:
1008
                size += s
999 1009
            serials += v
1000 1010
            for h in hashes:
1001 1011
                self.store.map_delete(h)
......
1004 1014
                props = self._get_version(node)
1005 1015
            except NameError:
1006 1016
                self.permissions.access_clear(path)
1007
            self._report_size_change(user, account, -size,
1008
                                    {'action': 'object purge', 'path': path,
1009
                                     'versions': ','.join(str(i) for i in serials)})
1017
            self._report_size_change(
1018
                user, account, -size, {
1019
                    'action': 'object purge',
1020
                    'path': path,
1021
                    'versions': ','.join(str(i) for i in serials)
1022
                }
1023
            )
1010 1024
            return
1011 1025

  
1012 1026
        path, node = self._lookup_object(account, container, name)

Also available in: Unified diff