kboss/b/hpc/bind_ldap.dspy
2025-07-16 14:27:17 +08:00

29 lines
738 B
Plaintext

async def bind_ldap(ns={}):
"""
绑定济南超算ldap账号
:param ns:
:return:
"""
nss = {
'id': ns.get('id'),
"clustercode": ns.get('clustercode'),
"queuecode": ns.get('queuecode'),
"ldapuid": ns.get('ldapuid'),
'orgid': ns.get('orgid')
}
db = DBPools()
async with db.sqlorContext('kboss') as sor:
try:
await sor.U('jncs_usermapping', nss)
return {
'status': True,
'msg': '用户和ldap绑定成功'
}
except Exception as e:
raise e
return {
'status': False,
'msg': '用户和ldap绑定失败'
}
ret = await bind_ldap(params_kw)
return ret