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