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:
parent
bbeadf7dbe
commit
f2404319af
apps/ops
@ -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
|
||||
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user