From c16f88d1481f59e8547c406ac24b670723a3b1da Mon Sep 17 00:00:00 2001 From: kpdev Date: Wed, 14 Apr 2021 09:38:45 +0200 Subject: [PATCH] Report ExternalDNSOverQuota exception for recordset quota error When floating IP or port with DNS records are created and the recordset quota value of the external dns service (e.g. designate) exceeds limit, the recordset creation fails. Report the exact reason of failure i.e. ExternalDNSOverQuota instead of HttpException. Depends-On: https://review.opendev.org/c/openstack/neutron-lib/+/786174 Closes-Bug: #1923700 Change-Id: Ie1dd5c26ec0eb1875d2a6a176838598117678f4a --- neutron/services/externaldns/drivers/designate/driver.py | 2 ++ ...add-ExternalDNSOverQuota-exception-8728f055d4f1d43c.yaml | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 releasenotes/notes/add-ExternalDNSOverQuota-exception-8728f055d4f1d43c.yaml diff --git a/neutron/services/externaldns/drivers/designate/driver.py b/neutron/services/externaldns/drivers/designate/driver.py index 11f88be5d8c..e5128a60946 100644 --- a/neutron/services/externaldns/drivers/designate/driver.py +++ b/neutron/services/externaldns/drivers/designate/driver.py @@ -102,6 +102,8 @@ class Designate(driver.ExternalDNSService): raise dns_exc.DNSDomainNotFound(dns_domain=dns_domain) except d_exc.Conflict: raise dns_exc.DuplicateRecordSet(dns_name=dns_name) + except d_exc.OverQuota: + raise dns_exc.ExternalDNSOverQuota(resource="recordset") if not CONF.designate.allow_reverse_dns_lookup: return diff --git a/releasenotes/notes/add-ExternalDNSOverQuota-exception-8728f055d4f1d43c.yaml b/releasenotes/notes/add-ExternalDNSOverQuota-exception-8728f055d4f1d43c.yaml new file mode 100644 index 00000000000..47ea765ba6b --- /dev/null +++ b/releasenotes/notes/add-ExternalDNSOverQuota-exception-8728f055d4f1d43c.yaml @@ -0,0 +1,6 @@ +--- +fixes: + - | + Report external dns service OverQuota exception as new neutron + ConflictException (409) i.e. ExternalDNSOverQuota. Report the failure + as "External DNS Quota exceeded for resources: recordset".