]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
log the callable if it has a docstring
authorAlfredo Deza <alfredo@deza.pe>
Fri, 2 Aug 2013 15:48:52 +0000 (11:48 -0400)
committerAlfredo Deza <alfredo@deza.pe>
Fri, 2 Aug 2013 15:48:52 +0000 (11:48 -0400)
Signed-off-by: Alfredo Deza <alfredo@deza.pe>
ceph_deploy/util/context.py

index 600c355507a21613b85d65eb4dadc339ed032ba1..56fc1e99179b15cc9d4e85be8fd22b5a6f886dd7 100644 (file)
@@ -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):