async def HpcLdapAdd(ns={}): """ 增加可用ldap账号 :param ns: :return: """ nss = { 'id': uuid(), "clustercode": ns.get('clustercode'), "queuecode": ns.get('queuecode'), "ldapuid": ns.get('ldapuid'), 'orgid': ns.get('orgid') or '', 'relate_config': ns.get('relate_config'), 'sync_status': 0 } db = DBPools() async with db.sqlorContext('kboss') as sor: try: await sor.C('jncs_usermapping', nss) return { 'status': True, 'msg': '添加ldap账号成功' } except Exception as e: return { 'status': False, 'msg': '添加ldap账号失败', 'err': e } ret = await HpcLdapAdd(params_kw) return ret