Check the project zone quota when accepting zone transfer.

Change-Id: I3cb6cf8c804f008244e34968101f7343be192d48
Closes-Bug: 1789876
This commit is contained in:
Dmitry Galkin 2018-08-30 12:35:19 +00:00
parent f6a7ea7d47
commit 709b272354
1 changed files with 4 additions and 0 deletions

View File

@ -2564,6 +2564,10 @@ class Service(service.RPCService, service.Service):
if zone.action == 'DELETE':
raise exceptions.BadRequest('Can not transfer a deleting zone')
# Ensure the accepting tenant has enough quota to continue
self._enforce_zone_quota(context,
zone_transfer_accept.tenant_id)
zone.tenant_id = zone_transfer_accept.tenant_id
self.storage.update_zone(elevated_context, zone)