Skip to content
Snippets Groups Projects
Commit a544f755 authored by Guido Trotter's avatar Guido Trotter
Browse files

confd: avoid spamming the logfile


When confd is disabled we don't want to be noticed every timer interval.

Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 73a465ee
No related branches found
No related tags found
No related merge requests found
......@@ -286,7 +286,7 @@ class ConfdConfigurationReloader(object):
else:
reloaded = self.processor.reader.Reload()
except errors.ConfigurationError:
self.DisableConfd()
self.DisableConfd(silent=was_disabled)
return
if self.polling and reloaded:
......@@ -311,11 +311,12 @@ class ConfdConfigurationReloader(object):
self._EnableTimer()
def DisableConfd(self):
def DisableConfd(self, silent=False):
"""Puts confd in non-serving mode
"""
logging.warning("Confd is being disabled")
if not silent:
logging.warning("Confd is being disabled")
self.processor.Disable()
self.polling = False
self._ResetTimer()
......@@ -350,6 +351,7 @@ def ExecConfd(options, args):
processor.Enable()
except errors.ConfigurationError:
# If enabling the processor has failed, we can still go on, but confd will be disabled
logging.warning("Confd is starting in disabled mode")
pass
server = ConfdAsyncUDPServer(options.bind_address, options.port, processor)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment