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 <[email protected]>
---
 lib/rpc/node.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/rpc/node.py b/lib/rpc/node.py
index 6c9647a..fd6ecef 100644
--- a/lib/rpc/node.py
+++ b/lib/rpc/node.py
@@ -106,24 +106,24 @@ 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
 
   curl.setopt(pycurl.FOLLOWLOCATION, False)
-  curl.setopt(pycurl.CAINFO, noded_cert)
   curl.setopt(pycurl.SSL_VERIFYHOST, 0)
   curl.setopt(pycurl.SSL_VERIFYPEER, True)
   curl.setopt(pycurl.SSLCERTTYPE, "PEM")
   curl.setopt(pycurl.SSLCERT, noded_client_cert)
   curl.setopt(pycurl.SSLKEYTYPE, "PEM")
   curl.setopt(pycurl.SSLKEY, noded_client_cert)
+  curl.setopt(pycurl.CAINFO, noded_cert)
   curl.setopt(pycurl.CONNECTTIMEOUT, constants.RPC_CONNECT_TIMEOUT)
 
 
-- 
2.4.3.573.g4eafbef

Reply via email to