Change the logic for deleting a record dns_domains.

Since keys are just the domain name, we need to be able
to reuse them.  That means we have to do a real record
deletion to free up namespace rather than just mark the
records as deleted.

For blueprint public-and-private-dns.

Change-Id: If47e961cf2cb977d297b506bd397f1a438499f18
This commit is contained in:
Andrew Bogott
2012-01-21 01:05:22 +00:00
parent 12068866f7
commit e763ffe6ea

View File

@@ -748,9 +748,9 @@ def dnsdomain_register_for_project(context, fqdomain, project):
def dnsdomain_unregister(context, fqdomain): def dnsdomain_unregister(context, fqdomain):
session = get_session() session = get_session()
with session.begin(): with session.begin():
domain_ref = _dnsdomain_get(context, session, fqdomain) session.query(models.DNSDomain).\
if domain_ref: filter_by(domain=fqdomain).\
domain_ref.delete(session=session) delete()
@require_context @require_context