You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by al...@apache.org on 2019/01/03 01:54:00 UTC

[2/3] kudu git commit: [python] handle DisableOpenSSLInitialization() result status

[python] handle DisableOpenSSLInitialization() result status

This patch adds verification for DisableOpenSSLInitialization().

The motivation for this change is two-fold:
  a) avoid glitches while initializing the OpenSSL library
     by python Kudu client if DisableOpenSSLInitialization()
     de facto failed
  b) get rid of compilation warnings on unhandled return value
     of the DisableOpenSSLInitialization() function

Change-Id: I1963b6d87d731fbfa87a09b986595aa8ea00da60
Reviewed-on: http://gerrit.cloudera.org:8080/12135
Tested-by: Alexey Serbin <as...@cloudera.com>
Reviewed-by: Adar Dembo <ad...@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/7337cf5f
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/7337cf5f
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/7337cf5f

Branch: refs/heads/master
Commit: 7337cf5fbffa954dab9f21fe6115f6df3ba7c6c7
Parents: 4a3e7c0
Author: Alexey Serbin <al...@apache.org>
Authored: Thu Dec 27 10:32:28 2018 -0800
Committer: Alexey Serbin <as...@cloudera.com>
Committed: Wed Jan 2 20:17:04 2019 +0000

----------------------------------------------------------------------
 python/kudu/client.pyx | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/7337cf5f/python/kudu/client.pyx
----------------------------------------------------------------------
diff --git a/python/kudu/client.pyx b/python/kudu/client.pyx
index 095488d..a37bd93 100644
--- a/python/kudu/client.pyx
+++ b/python/kudu/client.pyx
@@ -290,10 +290,11 @@ cdef class Client:
         # whether _ssl is present, and if we can import it, we disable
         # Kudu's initialization to avoid a conflict.
         try:
-          import _ssl
-          DisableOpenSSLInitialization()
+            import _ssl
         except:
-          pass
+            pass
+        else:
+            check_status(DisableOpenSSLInitialization())
 
         if isinstance(addr_or_addrs, six.string_types):
             addr_or_addrs = [addr_or_addrs]