From 2a446c5b6bf0fa76c7e569e159362ec0d4cf2e6c Mon Sep 17 00:00:00 2001 From: Nicolas Simonds <nic@metacloud.com> Date: Tue, 21 May 2013 16:19:38 -0700 Subject: [PATCH] Only add logging handlers if there currently aren't any This corrects an odd problem where Horizon would stand up multiple client objects, which would cause duplicate/triplicate/dozens of repeated log lines in its log files, due to multiple identical handlers being added to the logging object Fixes Bug 1182678 Change-Id: I198f3ecbb687bff69a06a166574b998cce54f2ac --- cinderclient/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinderclient/client.py b/cinderclient/client.py index 8e0d3230e..0cdb861c3 100644 --- a/cinderclient/client.py +++ b/cinderclient/client.py @@ -82,7 +82,7 @@ class HTTPClient(object): self.verify_cert = True self._logger = logging.getLogger(__name__) - if self.http_log_debug: + if self.http_log_debug and not self._logger.handlers: ch = logging.StreamHandler() self._logger.setLevel(logging.DEBUG) self._logger.addHandler(ch)