]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Don't require OpenSSL for unit tests
authorEric Harney <eharney@redhat.com>
Mon, 31 Aug 2015 18:12:53 +0000 (14:12 -0400)
committerEric Harney <eharney@redhat.com>
Mon, 31 Aug 2015 18:25:13 +0000 (14:25 -0400)
This allows unit tests to run w/o PyOpenSSL installed.

Closes-Bug: #1490668

Change-Id: I820875ca66d23327218cc5787ee357e78c812d7f

cinder/volume/drivers/emc/emc_vmax_https.py

index 154f48b5eb3fa24250e5e739b383db0c1b125547..aa9584f477038cc1cb8bf5618dcf080d806e6e69 100644 (file)
@@ -21,7 +21,10 @@ import string
 import struct
 
 from eventlet import patcher
-import OpenSSL
+try:
+    import OpenSSL
+except ImportError:
+    OpenSSL = None
 from oslo_log import log as logging
 import six
 from six.moves import http_client
@@ -30,10 +33,8 @@ from six.moves import urllib
 from cinder.i18n import _, _LI
 
 # Handle case where we are running in a monkey patched environment
-if patcher.is_monkey_patched('socket'):
+if OpenSSL and patcher.is_monkey_patched('socket'):
     from eventlet.green.OpenSSL import SSL
-else:
-    raise ImportError
 
 try:
     import pywbem