dogtag: Only call initialize() if crypto is not None

_setup_nss_db_services() can return None in case the config option
[dogtag_plugin]nss_db_path is not set.
In that case, don't call the initialize() method which would fail with:

AttributeError: 'NoneType' object has no attribute 'initialize'

Change-Id: Ia6ffc8945d8125047273872ba75f0b084dc5810f
This commit is contained in:
Thomas Bechtold 2016-07-19 16:21:47 +02:00
parent d89e93b290
commit 1d99f277ec

View File

@ -155,7 +155,8 @@ def create_connection(conf, subsystem_path):
return connection
crypto = _setup_nss_db_services(CONF)
crypto.initialize()
if crypto:
crypto.initialize()
class DogtagPluginAlgorithmException(exception.BarbicanException):