diff options
-rw-r--r-- | designate/backend/impl_multi.py | 7 | ||||
-rw-r--r-- | designate/tests/test_backend/test_multi.py | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/designate/backend/impl_multi.py b/designate/backend/impl_multi.py index 0c3f35c0..e6d38a07 100644 --- a/designate/backend/impl_multi.py +++ b/designate/backend/impl_multi.py @@ -106,10 +106,13 @@ class MultiBackend(base.Backend): self.master.update_domain(context, domain) def delete_domain(self, context, domain): - # Get the "full" domain (including id) from Central first, as we may + # Fetch the full domain from Central first, as we may # have to recreate it on slave if delete on master fails + deleted_context = context.deepcopy() + deleted_context.show_deleted = True + full_domain = self.central.find_domain( - context, {'name': domain['name']}) + deleted_context, {'id': domain['id']}) self.slave.delete_domain(context, domain) try: diff --git a/designate/tests/test_backend/test_multi.py b/designate/tests/test_backend/test_multi.py index d5694d14..cf7456f7 100644 --- a/designate/tests/test_backend/test_multi.py +++ b/designate/tests/test_backend/test_multi.py @@ -103,6 +103,7 @@ class MultiBackendTestCase(tests.TestCase, BackendTestMixin): def test_delete_domain(self): context = self.get_context() domain = self.get_domain_fixture() + domain['id'] = 'a8aeb2ee-40da-476b-a9d8-26bf0c0065f6' # Since multi's delete fetches the domain from central to be able to # recreate it if something goes wrong, create the domain first |