You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by to...@apache.org on 2019/12/18 22:24:13 UTC

[libcloud] branch trunk updated (402d947 -> 2689809)

This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git.


    from 402d947  Merge branch 'trunk' of http://gitbox.apache.org/repos/asf/libcloud into trunk
     new 222749b  Make OpenSSL import lazy since only two methods depend on it.
     new 2689809  Add pyopenssl dependency to requirements-tests.txt file.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 libcloud/loadbalancer/drivers/nttcis.py | 19 ++++++++++++-------
 requirements-tests.txt                  |  2 ++
 tox.ini                                 |  1 -
 3 files changed, 14 insertions(+), 8 deletions(-)


[libcloud] 02/02: Add pyopenssl dependency to requirements-tests.txt file.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 2689809c7a4355907d462c3cc5976e79688e7de2
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Wed Dec 18 23:19:27 2019 +0100

    Add pyopenssl dependency to requirements-tests.txt file.
    
    Resolves #1385.
---
 requirements-tests.txt | 2 ++
 tox.ini                | 1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/requirements-tests.txt b/requirements-tests.txt
index b53423a..2f6bb7e 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -9,3 +9,5 @@ requests
 requests_mock
 pytest==4.6.5
 cryptography==2.6.1
+# NOTE: Only needed by nttcis loadbalancer driver
+pyopenssl
diff --git a/tox.ini b/tox.ini
index a0e7abd..d48ed6d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -6,7 +6,6 @@ skipsdist = true
 passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
 deps =
     -r{toxinidir}/requirements-tests.txt
-    pyopenssl
     lockfile
     libvirt-python==5.9.0
     py2.7: paramiko


[libcloud] 01/02: Make OpenSSL import lazy since only two methods depend on it.

Posted by to...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit 222749bab9c782974aff0ab68f549b8dc0ca44ae
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Wed Dec 18 23:18:29 2019 +0100

    Make OpenSSL import lazy since only two methods depend on it.
---
 libcloud/loadbalancer/drivers/nttcis.py | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/libcloud/loadbalancer/drivers/nttcis.py b/libcloud/loadbalancer/drivers/nttcis.py
index 5c24ce6..b0a0bf9 100644
--- a/libcloud/loadbalancer/drivers/nttcis.py
+++ b/libcloud/loadbalancer/drivers/nttcis.py
@@ -13,13 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-try:
-    import OpenSSL
-    OpenSSL
-except ImportError:
-    raise ImportError('Missing "OpenSSL" dependency. You can install it '
-                      'using pip - pip install pyopenssl')
-from OpenSSL import crypto
 from libcloud.utils.py3 import ET
 from libcloud.common.nttcis import NttCisConnection
 from libcloud.common.nttcis import NttCisPool
@@ -783,6 +776,11 @@ class NttCisLBDriver(Driver):
         :type `description: `str``
         :return: ``bool``
         """
+        try:
+            import OpenSSL
+        except ImportError:
+            raise ImportError('Missing "OpenSSL" dependency. You can install it '
+                            'using pip - pip install pyopenssl')
 
         with open(crt_file) as fp:
             c = OpenSSL.crypto.load_certificate(
@@ -846,6 +844,13 @@ class NttCisLBDriver(Driver):
         :type description: ``str``
         :return: ``bool``
         """
+        try:
+            import OpenSSL
+            from OpenSSL import crypto
+        except ImportError:
+            raise ImportError('Missing "OpenSSL" dependency. You can install it '
+                            'using pip - pip install pyopenssl')
+
         c = crypto.load_certificate(
             crypto.FILETYPE_PEM, open(chain_crt_file).read())
         cert = OpenSSL.crypto.dump_certificate(