summaryrefslogtreecommitdiff
path: root/designate/backend/impl_pdns4.py
diff options
context:
space:
mode:
Diffstat (limited to 'designate/backend/impl_pdns4.py')
-rw-r--r--designate/backend/impl_pdns4.py21
1 files changed, 14 insertions, 7 deletions
diff --git a/designate/backend/impl_pdns4.py b/designate/backend/impl_pdns4.py
index 576dddd5..7149beba 100644
--- a/designate/backend/impl_pdns4.py
+++ b/designate/backend/impl_pdns4.py
@@ -106,10 +106,17 @@ class PDNS4Backend(base.Backend):
def delete_zone(self, context, zone):
"""Delete a DNS zone"""
- try:
- requests.delete(
- self._build_url(zone.name),
- headers=self.headers
- ).raise_for_status()
- except requests.HTTPError as e:
- raise exceptions.Backend(e)
+ # First verify that the zone exists -- If it's not present
+ # in the backend then we can just declare victory.
+ if self._check_zone_exists(zone):
+ try:
+ requests.delete(
+ self._build_url(zone.name),
+ headers=self.headers
+ ).raise_for_status()
+ except requests.HTTPError as e:
+ raise exceptions.Backend(e)
+ else:
+ LOG.warning("Trying to delete zone %s but that zone is not "
+ "present in the pdns backend. Assuming success.",
+ zone)