From afae8886640acbc09ec43f6ae48bd53286f4779e Mon Sep 17 00:00:00 2001 From: Eva Balycheva Date: Mon, 12 Oct 2015 20:28:25 +0300 Subject: [PATCH] Make websocket run in correct logging mode Currently websocket always runs in debug mode. It is because the method variable is passed as a "debug" parameter to websocket constructor instead of boolean variable. So websocket will interpret this parameter as true and debug mode will be on. This commit makes sure the variable passed as "debug" parameter to websocket constructor is boolean and really tells if zaqar-server's debug logging is enabled. This boolean variable is aquired from the information in local logger instance. Change-Id: I701f986a85bdb024c3757ede5a388a78791343aa Closes-Bug: 1505263 --- zaqar/transport/websocket/driver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zaqar/transport/websocket/driver.py b/zaqar/transport/websocket/driver.py index 065674dd7..3d76caf6b 100644 --- a/zaqar/transport/websocket/driver.py +++ b/zaqar/transport/websocket/driver.py @@ -72,9 +72,10 @@ class Driver(base.DriverBase): @decorators.lazy_property(write=False) def factory(self): uri = 'ws://' + self._ws_conf.bind + ':' + str(self._ws_conf.port) + debug_enabled = LOG.isEnabledFor(logging.DEBUG) return factory.ProtocolFactory( uri, - debug=LOG.debug, + debug=debug_enabled, handler=self._api, external_port=self._ws_conf.external_port, auth_strategy=self._auth_strategy,