mirror of
https://github.com/kakwa/ldapcherry
synced 2024-11-22 09:24:21 +01:00
adding a get_param method + pass backend name to backend
This commit is contained in:
parent
a8c61d33e6
commit
3ab1cbcdb2
@ -107,7 +107,7 @@ class LdapCherry(object):
|
||||
except:
|
||||
raise BackendModuleLoadingFail(module)
|
||||
try:
|
||||
self.backends[backend] = bc.Backend(params, cherrypy.log)
|
||||
self.backends[backend] = bc.Backend(params, cherrypy.log, backend)
|
||||
except:
|
||||
raise BackendModuleInitFail(module)
|
||||
|
||||
|
@ -5,6 +5,8 @@
|
||||
# LdapCherry
|
||||
# Copyright (c) 2014 Carpentier Pierre-Francois
|
||||
|
||||
from ldapcherry.exceptions import MissingParameter
|
||||
|
||||
class Backend:
|
||||
|
||||
def __init__(self):
|
||||
@ -21,3 +23,12 @@ class Backend:
|
||||
|
||||
def rm_from_group(self):
|
||||
pass
|
||||
|
||||
def get_param(self, param, default=False):
|
||||
if param in self.config:
|
||||
return self.config[param]
|
||||
elif default:
|
||||
return default
|
||||
else:
|
||||
raise MissingParameter(self.backend_name+'.'+param, 'backends')
|
||||
|
||||
|
@ -9,5 +9,5 @@ import ldapcherry.backend
|
||||
|
||||
class Backend(ldapcherry.backend.Backend):
|
||||
|
||||
def __init__(self, config, logger):
|
||||
def __init__(self, config, logger, name):
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user