From: John Griffith Date: Tue, 4 Jun 2013 18:59:20 +0000 (-0600) Subject: Elevate acceptors context on accept reserve udpate X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=e02cf9c373daa7b03e141e016fb166841f6b02b7;p=openstack-build%2Fcinder-build.git Elevate acceptors context on accept reserve udpate When accepting a transfer we need to update the quota data for both the donor and the acceptor's. The acceptor is easy enough (as that's the context we currently are using) however to update the donor's quota data we need an elevated context. Fixes bug: 1187538 Change-Id: I1fb9e7726830dce2c3de23d3446de5bbe9a1fd24 --- diff --git a/cinder/transfer/api.py b/cinder/transfer/api.py index e139951a2..ffd049ca7 100644 --- a/cinder/transfer/api.py +++ b/cinder/transfer/api.py @@ -166,7 +166,7 @@ class API(base.Base): raise exception.VolumeLimitExceeded(allowed=quotas['volumes']) try: donor_id = vol_ref['project_id'] - donor_reservations = QUOTAS.reserve(context, + donor_reservations = QUOTAS.reserve(context.elevated(), project_id=donor_id, volumes=-1, gigabytes=-vol_ref['size'])