if username and password:
try:
- userdata = self._authenticate(username, password)
- if userdata:
- userattrs = dict()
- for d, v in userdata.get('userdata', {}).items():
- userattrs[d] = v
- if 'groups' in userdata:
- userattrs['groups'] = userdata['groups']
- if 'extras' in userdata:
- userattrs['extras'] = userdata['extras']
+ userattrs = self._authenticate(username, password)
authed = True
except Exception, e: # pylint: disable=broad-except
errmsg = "Authentication failed"
def install_args(self, group):
group.add_argument('--ldap', choices=['yes', 'no'], default='no',
- help='Configure PAM authentication')
+ help='Configure LDAP authentication')
group.add_argument('--ldap-server-url', action='store',
help='LDAP Server Url')
group.add_argument('--ldap-bind-dn-template', action='store',