]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Merge "After commiting quota we should avoid certain reverts"
authorJenkins <jenkins@review.openstack.org>
Wed, 2 Oct 2013 21:45:12 +0000 (21:45 +0000)
committerGerrit Code Review <review@openstack.org>
Wed, 2 Oct 2013 21:45:12 +0000 (21:45 +0000)
1  2 
cinder/volume/flows/create_volume/__init__.py

index 03a7933e11cd44da9480695681d53bd794369c46,7883f8c6d09dd4a09d15480d7e530113ba6f5c1b..aead0b5cc2f365d0b8c977ca43fb5c828c1a4da6
@@@ -573,9 -573,13 +573,13 @@@ class EntryCreateTask(base.CinderTask)
          # We never produced a result and therefore can't destroy anything.
          if not result:
              return
+         if context.quota_committed:
+             # Committed quota doesn't rollback as the volume has already been
+             # created at this point, and the quota has already been absorbed.
+             return
          vol_id = result['volume_id']
          try:
 -            self.db.volume_destroy(context, vol_id)
 +            self.db.volume_destroy(context.elevated(), vol_id)
          except exception.CinderException:
              # We are already reverting, therefore we should silence this
              # exception since a second exception being active will be bad.