Revision b2691c21

b/snf-pithos-backend/pithos/backends/modular.py
825 825

  
826 826
        del_size = self._apply_versioning(account, container, pre_version_id)
827 827
        size_delta = size - del_size
828
#        # Check quota.
829
#         if size_delta > 0:
830
#             account_quota = long(self._get_policy(account_node)['quota'])
831
#             container_quota = long(self._get_policy(container_node)['quota'])
832
#             if (account_quota > 0 and self._get_statistics(account_node)[1] + size_delta > account_quota) or \
833
#                (container_quota > 0 and self._get_statistics(container_node)[1] + size_delta > container_quota):
834
#                 # This must be executed in a transaction, so the version is never created if it fails.
835
#                 raise QuotaError
828
        if not quotaholder_url:	# Check quota.
829
        if size_delta > 0:
830
            account_quota = long(self._get_policy(account_node)['quota'])
831
            container_quota = long(self._get_policy(container_node)['quota'])
832
            if (account_quota > 0 and self._get_statistics(account_node)[1] + size_delta > account_quota) or \
833
               (container_quota > 0 and self._get_statistics(container_node)[1] + size_delta > container_quota):
834
                # This must be executed in a transaction, so the version is never created if it fails.
835
                raise QuotaError
836 836
        self._report_size_change(user, account, size_delta,
837 837
                                 {'action': 'object update', 'path': path,
838 838
                                  'versions': ','.join([str(dest_version_id)])})

Also available in: Unified diff