Merge pull request #31972 from terminalmage/zh-584

Make lack of python-ldap module more explicit when LDAP eauth is enabled
This commit is contained in:
Nicole Thomas 2016-03-18 09:11:58 -06:00
commit a52e3ad7a1

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)