Make lack of python-ldap module more explicit when LDAP eauth is enabled

This commit is contained in:
Erik Johnson 2016-03-17 21:05:55 -05:00
parent 2d1f2a0c2e
commit 1e5639e495

View file

@ -84,8 +84,10 @@ class _LDAPConnection(object):
self.binddn = binddn
self.bindpw = bindpw
if not HAS_LDAP:
raise CommandExecutionError('Failed to connect to LDAP, module '
'not loaded')
raise CommandExecutionError(
'LDAP connection could not be made, the python-ldap module is '
'not installed. Install python-ldap to use LDAP external auth.'
)
if self.uri == '':
self.uri = '{0}://{1}:{2}'.format(schema, self.server, self.port)