From a544f755c18234430c2cc1bc819dc16eb8fb3d58 Mon Sep 17 00:00:00 2001 From: Guido Trotter <ultrotter@google.com> Date: Fri, 28 Aug 2009 18:18:17 +0300 Subject: [PATCH] confd: avoid spamming the logfile When confd is disabled we don't want to be noticed every timer interval. Signed-off-by: Guido Trotter <ultrotter@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- daemons/ganeti-confd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/daemons/ganeti-confd b/daemons/ganeti-confd index 558d82a26..273976920 100755 --- a/daemons/ganeti-confd +++ b/daemons/ganeti-confd @@ -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) -- GitLab