From c09750420ca00ebaafe54107fb2c952a48b45d2b Mon Sep 17 00:00:00 2001 From: Graham Hayes Date: Tue, 24 Feb 2015 13:55:43 +0000 Subject: [PATCH] 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 --- designate/central/service.py | 2 +- designate/tests/test_central/test_service.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/designate/central/service.py b/designate/central/service.py index 4a609c226..3e5de13dc 100644 --- a/designate/central/service.py +++ b/designate/central/service.py @@ -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) diff --git a/designate/tests/test_central/test_service.py b/designate/tests/test_central/test_service.py index 0804aee2d..45daff134 100644 --- a/designate/tests/test_central/test_service.py +++ b/designate/tests/test_central/test_service.py @@ -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.')