Fixed _is_superdomain check in central

Previously this search term would match on the domain test so that
t.zone.fqdn. would be marked as a super domain of test.zone.fqdn.

This ensures the check only matches true super domains

Change-Id: I9e2b28b6dfbe7e1822b4ba5f96f96d2bb15ea248
Closes-Bug: 1423148
This commit is contained in:
Graham Hayes 2015-02-24 13:55:43 +00:00
parent de19e59889
commit c09750420c
2 changed files with 1 additions and 5 deletions

View File

@ -440,7 +440,7 @@ class Service(service.RPCService):
context.all_tenants = True
# Create wildcard term to catch all subdomains
search_term = "*%s" % domain_name
search_term = "*.%s" % domain_name
criterion = {'name': search_term}
subdomains = self.storage.find_domains(context, criterion)

View File

@ -179,10 +179,6 @@ class CentralServiceTest(CentralTestCase):
'www.example.net.')
self.assertFalse(result)
LOG.debug("Testing 'example.org.'")
result = self.central_service._is_superdomain(context, 'example.org.')
self.assertTrue(result)
LOG.debug("Testing 'www.example.org.'")
result = self.central_service._is_superdomain(context,
'www.example.org.')