修复一些BUG

将修改密码的代码逻辑做复用处理,简化代码。
This commit is contained in:
向乐🌌
2021-05-20 12:02:11 +08:00
parent 4ad2a126d8
commit ca84457c1f
9 changed files with 224 additions and 212 deletions

View File

@@ -52,8 +52,8 @@ class AdOps(object):
authentication=self.authentication, raise_exceptions=True)
except LDAPOperationResult as e:
raise LDAPOperationResult("LDAPOperationResult: " + str(e))
except Exception:
raise Exception('出现错误无法连接到AD控制器。')
except Exception as e:
raise Exception('LDAP Exception无法连接到AD控制器 --- {}' .format(e))
def ad_auth_user(self, username, password):
"""