From c29e35fec1dc12c36585e7af731bef56c93dcbd6 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Tue, 26 Oct 2010 15:02:01 +0200
Subject: [PATCH] rpc: Work around epydoc warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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 | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/rpc.py b/lib/rpc.py
index 012664286..dac81f20a 100644
--- a/lib/rpc.py
+++ b/lib/rpc.py
@@ -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()
 
 
-- 
GitLab