Clean up configuration of curl request
authorHelga Velroyen <helgav@google.com>
Mon, 22 Jun 2015 12:43:12 +0000 (14:43 +0200)
committerHelga Velroyen <helgav@google.com>
Mon, 6 Jul 2015 10:46:31 +0000 (12:46 +0200)
This is a small patch cleaning up some thing in the
composition of the pycurl object for RPC calls.
For example, it removes some superfluous 'str' and
increases the logging level to warning when the
server cert is used.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

lib/rpc/node.py

index 6c9647a..e5d77cf 100644 (file)
@@ -106,13 +106,13 @@ def Shutdown():
 
 
 def _ConfigRpcCurl(curl):
-  noded_cert = str(pathutils.NODED_CERT_FILE)
-  noded_client_cert = str(pathutils.NODED_CLIENT_CERT_FILE)
+  noded_cert = pathutils.NODED_CERT_FILE
+  noded_client_cert = pathutils.NODED_CLIENT_CERT_FILE
 
   # FIXME: The next two lines are necessary to ensure upgradability from
   # 2.10 to 2.11. Remove in 2.12, because this slows down RPC calls.
   if not os.path.exists(noded_client_cert):
-    logging.info("Using server certificate as client certificate for RPC"
+    logging.warn("Using server certificate as client certificate for RPC"
                  "call.")
     noded_client_cert = noded_cert