Don't require OpenSSL for unit tests
This allows unit tests to run w/o PyOpenSSL installed. Closes-Bug: #1490668 Change-Id: I820875ca66d23327218cc5787ee357e78c812d7f
This commit is contained in:
parent
77d6bf6550
commit
5b45dcf3a0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user