summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2019-09-12 18:33:24 +0000
committerGerrit Code Review <review@openstack.org>2019-09-12 18:33:24 +0000
commit43d544483666377c0bc076edc868437b28472f2d (patch)
treef5ffeea2d1ea780f7df7145d2148f93fb5401649
parent17c26a47582518c3fad895febdaafac3a629ba6e (diff)
parentbcaf9fd149e36c437b65220de64a7a195301a337 (diff)
downloaddesignate-43d544483666377c0bc076edc868437b28472f2d.tar.gz
Merge "Only log zone not found when notifing"
-rw-r--r--designate/mdns/notify.py32
1 files changed, 20 insertions, 12 deletions
diff --git a/designate/mdns/notify.py b/designate/mdns/notify.py
index a8f54b05..0de21f5c 100644
--- a/designate/mdns/notify.py
+++ b/designate/mdns/notify.py
@@ -252,21 +252,29 @@ class NotifyEndpoint(base.BaseEndpoint):
# recover by retrying
break
+ if not response:
+ return None, retry
+
# Check that we actually got a NOERROR in the rcode and and an
# authoritative answer
- if response is None:
- pass
-
- elif (response.rcode() in
- (dns.rcode.NXDOMAIN, dns.rcode.REFUSED,
- dns.rcode.SERVFAIL)) or \
+ refused_statuses = (
+ dns.rcode.NXDOMAIN, dns.rcode.REFUSED, dns.rcode.SERVFAIL
+ )
+ if (response.rcode() in refused_statuses or
(response.rcode() == dns.rcode.NOERROR and
- not bool(response.answer)):
- LOG.info("%(zone)s not found on %(server)s:%(port)d",
- {'zone': zone.name, 'server': host, 'port': port})
-
- elif not (response.flags & dns.flags.AA) or dns.rcode.from_flags(
- response.flags, response.ednsflags) != dns.rcode.NOERROR:
+ not bool(response.answer))):
+ if notify:
+ LOG.info(
+ '%(zone)s not found on %(server)s:%(port)d',
+ {
+ 'zone': zone.name,
+ 'server': host,
+ 'port': port
+ }
+ )
+ elif (not (response.flags & dns.flags.AA) or
+ dns.rcode.from_flags(response.flags,
+ response.ednsflags) != dns.rcode.NOERROR):
LOG.warning("Failed to get expected response while trying to "
"send '%(msg)s' for '%(zone)s' to '%(server)s:"
"%(port)d'.\nResponse message:\n%(resp)s\n",