rpc: Work around epydoc warning
authorMichael Hanselmann <hansmi@google.com>
Tue, 26 Oct 2010 13:02:01 +0000 (15:02 +0200)
committerMichael Hanselmann <hansmi@google.com>
Tue, 26 Oct 2010 13:39:37 +0000 (15:39 +0200)
Aliasing the “threading” module allows us to avoid the “No information
available for ganeti.rpc._RpcThreadLocal's base threading.local” warning
by epydoc.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: René Nussbaumer <rn@google.com>

lib/rpc.py

index 0126642..dac81f2 100644 (file)
@@ -119,7 +119,12 @@ def _ConfigRpcCurl(curl):
   curl.setopt(pycurl.CONNECTTIMEOUT, _RPC_CONNECT_TIMEOUT)
 
 
-class _RpcThreadLocal(threading.local):
+# Aliasing this module avoids the following warning by epydoc: "Warning: No
+# information available for ganeti.rpc._RpcThreadLocal's base threading.local"
+_threading = threading
+
+
+class _RpcThreadLocal(_threading.local):
   def GetHttpClientPool(self):
     """Returns a per-thread HTTP client pool.
 
@@ -135,6 +140,10 @@ class _RpcThreadLocal(threading.local):
     return pool
 
 
+# Remove module alias (see above)
+del _threading
+
+
 _thread_local = _RpcThreadLocal()