Liron Ar has uploaded a new change for review.
Change subject: utils
......................................................................
utils
Change-Id: Icbd049360a02ae98fa21756dc734c1da8ac3d11a
Signed-off-by: Liron Aravot <laravot(a)redhat.com>
---
M lib/vdsm/utils.py
1 file changed, 26 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/30/23130/1
diff --git a/lib/vdsm/utils.py b/lib/vdsm/utils.py
index d593a73..e39a245 100644
--- a/lib/vdsm/utils.py
+++ b/lib/vdsm/utils.py
@@ -52,6 +52,7 @@
import threading
import time
import zombiereaper
+import inspect
from cpopen import CPopen
from . import constants
@@ -643,6 +644,31 @@
return False
+def traced(on=""):
+
+ def func_decorator(func, log):
+ def wrapper(self, *a, **kw):
+ log.debug("executing %s with a= %s,kw= %s", func.func_name, a, kw)
+ return func(self, *a, **kw)
+ return wrapper
+
+ def decorator(cls):
+ log = logging.getLogger(on)
+ log.debug("aasd")
+ for name in dir(cls):
+ value = getattr(cls, name)
+ log.debug(name)
+ log.debug(type(value))
+
+ if inspect.ismethod(value):
+ setattr(cls, name, func_decorator(value, log))
+ log.debug("name = %s , value = %s was wrapped", name, value)
+
+ return cls
+
+ return decorator
+
+
def _getAllMacs():
# (
--
To view, visit
http://gerrit.ovirt.org/23130
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbd049360a02ae98fa21756dc734c1da8ac3d11a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <laravot(a)redhat.com>