From b591ad75002bbdf58fd4bf81576c255e818b9dd0 Mon Sep 17 00:00:00 2001 From: Erik Olof Gunnar Andersson Date: Thu, 5 Sep 2019 19:38:35 -0700 Subject: Only log unexpected rndc errors A common false positive when bind is failing to create a zone is the output that the zone already exists. This is usually due to a misconfiguration, and not because the rndc command is failing. We still log the rndc output using debug, and log it in cases where it only would fail due to legit issues talking to bind. Change-Id: If0f6dd84959f67f32394084ea66d54e210dad966 --- designate/backend/impl_bind9.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designate/backend/impl_bind9.py b/designate/backend/impl_bind9.py index aead79f7..0c1c853c 100644 --- a/designate/backend/impl_bind9.py +++ b/designate/backend/impl_bind9.py @@ -97,6 +97,7 @@ class Bind9Backend(base.Backend): except exceptions.Backend as e: # If create fails because the zone exists, don't reraise if "already exists" not in six.text_type(e): + LOG.warning('RNDC call failure: %s', e) raise self.mdns_api.notify_zone_changed( @@ -123,6 +124,7 @@ class Bind9Backend(base.Backend): except exceptions.Backend as e: # If zone is already deleted, don't reraise if "not found" not in six.text_type(e): + LOG.warning('RNDC call failure: %s', e) raise def _execute_rndc(self, rndc_op): @@ -138,5 +140,4 @@ class Bind9Backend(base.Backend): LOG.debug('Executing RNDC call: %r', rndc_call) utils.execute(*rndc_call) except utils.processutils.ProcessExecutionError as e: - LOG.info('RNDC call failure: %s', e) raise exceptions.Backend(e) -- cgit v1.2.1