Revision a74ba506 snf-pithos-backend/pithos/backends/modular.py

b/snf-pithos-backend/pithos/backends/modular.py
104 104
        try:
105 105
            self.messages = []
106 106
            ret = func(self, *args, **kw)
107
            self.wrapper.commit()
108 107
            for m in self.messages:
109 108
                self.queue.send(*m)
109
            self.wrapper.commit()
110 110
            return ret
111 111
        except:
112 112
            self.wrapper.rollback()
......
603 603
        path = self._lookup_object(account, container, name)[0]
604 604
        self._check_permissions(path, permissions)
605 605
        self.permissions.access_set(path, permissions)
606
        self._report_sharing_change(user, account, path, {'members':self.permissions.access_members(path)})
606 607
    
607 608
    @backend_method
608 609
    def get_object_public(self, user, account, container, name):
......
671 672
        
672 673
        if permissions is not None:
673 674
            self.permissions.access_set(path, permissions)
675
            self._report_sharing_change(user, account, path, {'members':self.permissions.access_members(path)})
674 676
        
675 677
        self._report_object_change(user, account, path, details={'version': dest_version_id, 'action': 'object update'})
676 678
        return dest_version_id
......
1018 1020
        details.update({'user': user})
1019 1021
        self.messages.append((QUEUE_MESSAGE_KEY_PREFIX % ('object',), account, QUEUE_INSTANCE_ID, 'object', path, details))
1020 1022
    
1023
    def _report_sharing_change(self, user, account, path, details={}):
1024
        logger.debug("_report_permissions_change: %s %s %s %s", user, account, path, details)
1025
        details.update({'user': user})
1026
        self.messages.append((QUEUE_MESSAGE_KEY_PREFIX % ('sharing',), account, QUEUE_INSTANCE_ID, 'sharing', path, details))
1027
    
1021 1028
    # Policy functions.
1022 1029
    
1023 1030
    def _check_policy(self, policy):

Also available in: Unified diff