Merge "Fix the child search logic during zone deletion."

This commit is contained in:
Zuul 2019-01-17 23:32:59 +00:00 committed by Gerrit Code Review
commit 67a81e4e96
1 changed files with 3 additions and 1 deletions

View File

@ -1094,7 +1094,9 @@ class Service(service.RPCService, service.Service):
# Prevent deletion of a zone which has child zones
criterion = {'parent_zone_id': zone_id}
if self.storage.count_zones(context, criterion) > 0:
# Look for child zones across all tenants with elevated context
if self.storage.count_zones(context.elevated(all_tenants=True),
criterion) > 0:
raise exceptions.ZoneHasSubZone('Please delete any subzones '
'before deleting this zone')