ensure required parameters are set at the time of a request

This commit is contained in:
Igor Ippolitov 2016-11-02 15:12:08 +03:00
parent 5fec096aa6
commit 438518509d
1 changed files with 9 additions and 0 deletions

View File

@ -180,6 +180,15 @@ class LDAPAuthHandler(AuthHandler):
return
try:
# check that uri and baseDn are set
# either from cli or a request
if not ctx['url']:
self.log_message('LDAP URL is not set!')
return
if not ctx['basedn']:
self.log_message('LDAP baseDN is not set!')
return
ctx['action'] = 'initializing LDAP connection'
ldap_obj = ldap.initialize(ctx['url']);