Change in vdsm[master]: json: use forzenset for filtered methods

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Mon Feb 29 12:53:41 UTC 2016


Piotr Kliczewski has uploaded a new change for review.

Change subject: json: use forzenset for filtered methods
......................................................................

json: use forzenset for filtered methods


Change-Id: I17becc319fb8e226f0badc883007900c8862a520
Signed-off-by: pkliczewski <piotr.kliczewski at gmail.com>
---
M lib/yajsonrpc/__init__.py
1 file changed, 5 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/60/54160/1

diff --git a/lib/yajsonrpc/__init__.py b/lib/yajsonrpc/__init__.py
index 3724a91..aa7e82d 100644
--- a/lib/yajsonrpc/__init__.py
+++ b/lib/yajsonrpc/__init__.py
@@ -469,6 +469,10 @@
 class JsonRpcServer(object):
     log = logging.getLogger("jsonrpc.JsonRpcServer")
 
+    filtered_methods = frozenset(['Host_getVMList', 'Host_getAllVmStats',
+                                  'Host_getStats', 'StorageDomain_getStats',
+                                  'VM_getStats', 'Host_fenceNode'])
+
     """
     Creates new JsonrRpcServer by providing a bridge, timeout in seconds
     which defining how often we should log connections stats and thread
@@ -502,9 +506,7 @@
         self._attempt_log_stats()
         mangledMethod = req.method.replace(".", "_")
         logLevel = logging.DEBUG
-        if mangledMethod in ('Host_getVMList', 'Host_getAllVmStats',
-                             'Host_getStats', 'StorageDomain_getStats',
-                             'VM_getStats', 'Host_fenceNode'):
+        if mangledMethod in self.filtered_methods:
             logLevel = logging.TRACE
         self.log.log(logLevel, "Calling '%s' in bridge with %s",
                      req.method, req.params)


-- 
To view, visit https://gerrit.ovirt.org/54160
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I17becc319fb8e226f0badc883007900c8862a520
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>


More information about the vdsm-patches mailing list