summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKiall Mac Innes <kiall@hp.com>2014-09-15 16:04:18 +0100
committerKiall Mac Innes <kiall@hp.com>2014-09-30 22:12:27 +0000
commit4de363a5eeb07dae13cfab653ef92798966c8e1d (patch)
treecd577ca74c2489e56da51e8d901bf43784121788
parentdf4284aebc9af3059726785449231def15147319 (diff)
downloaddesignate-proposed/juno.tar.gz
Multi backend attepts to read a deleted domain2014.2.rc22014.2proposed/juno
This effectively results in all delete-domain requests failing when the multi backend is used. Closes-Bug: 1375397 Change-Id: I05a54600bf7493ff467b8f5a81af7d682fe5ca7a
-rw-r--r--designate/backend/impl_multi.py7
-rw-r--r--designate/tests/test_backend/test_multi.py1
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