From cd13bf5d2271f8e862c32b62bd872af63c939b65 Mon Sep 17 00:00:00 2001 From: kakwa Date: Thu, 2 Jul 2015 08:35:44 +0200 Subject: [PATCH] fix error if no ppolicy module --- ldapcherry/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ldapcherry/__init__.py b/ldapcherry/__init__.py index 1b60b72..1f83017 100644 --- a/ldapcherry/__init__.py +++ b/ldapcherry/__init__.py @@ -177,7 +177,11 @@ class LdapCherry(object): pp = __import__(module, globals(), locals(), ['PPolicy'], -1) except: raise BackendModuleLoadingFail(module) - self.ppolicy = pp.PPolicy(config['ppolicy'], cherrypy.log) + if 'ppolicy' in config: + ppcfg = config['ppolicy'] + else: + ppcfg = {} + self.ppolicy = pp.PPolicy(ppcfg, cherrypy.log) def _init_auth(self, config): """ Init authentication