From 1d99f277eccbc713c0416f273f2439b33a59d9d7 Mon Sep 17 00:00:00 2001 From: Thomas Bechtold Date: Tue, 19 Jul 2016 16:21:47 +0200 Subject: [PATCH] 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 --- barbican/plugin/dogtag.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/barbican/plugin/dogtag.py b/barbican/plugin/dogtag.py index 2d3a49bd8..57399e4e3 100644 --- a/barbican/plugin/dogtag.py +++ b/barbican/plugin/dogtag.py @@ -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):