From 55cbae85999d120c9ccd738bdb859054b4e006da Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Fri, 2 Aug 2013 11:48:52 -0400 Subject: [PATCH] log the callable if it has a docstring Signed-off-by: Alfredo Deza --- ceph_deploy/util/context.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ceph_deploy/util/context.py b/ceph_deploy/util/context.py index 600c355..56fc1e9 100644 --- a/ceph_deploy/util/context.py +++ b/ceph_deploy/util/context.py @@ -26,6 +26,7 @@ class remote(object): self.client = client self.logger = logger self.func = func + self.description = getattr(func, 'func_doc') self.mangle_exc = mangle_exc def __enter__(self): @@ -34,6 +35,8 @@ class remote(object): self.client.modules.sys.stdout = StringIO.StringIO() self.client.modules.sys.stderr = StringIO.StringIO() + if self.description: + self.logger.info(self.description) return remote_compile(self.client, self.func) def __exit__(self, e_type, e_val, e_traceback): -- 2.47.3