1
0
mirror of https://github.com/jumpserver/jumpserver.git synced 2025-05-10 17:15:16 +00:00

fix: account_prefer

This commit is contained in:
wangruidong 2025-04-09 11:17:47 +08:00 committed by w940853815
parent bbeadf7dbe
commit f2404319af
2 changed files with 1 additions and 13 deletions
apps/ops

View File

@ -326,21 +326,9 @@ class JMSInventory:
'ip': host['ansible_host'],
'id': host.get('jms_asset', {}).get('id')
})
# 获取跳过的主机
skipped_hosts = []
for name, error in self.exclude_hosts.items():
if any(h['name'] == name for h in error_hosts):
continue
skipped_hosts.append({
'name': name,
'error': error
})
result = {
'runnable': runnable_hosts,
'error': error_hosts,
'skipped': skipped_hosts
}
return result

View File

@ -19,7 +19,7 @@ class InventoryClassifiedHostsAPI(APIView):
asset_ids = request.data.get('assets', [])
node_ids = request.data.get('nodes', [])
runas_policy = request.data.get('runas_policy', 'privileged_first')
account_prefer = request.data.get('account_prefer', 'root,Administrator')
account_prefer = request.data.get('runas', 'root,Administrator')
module = request.data.get('module', 'shell')
# 合并节点和资产
assets = list(Asset.objects.filter(id__in=asset_ids).all())