Merge pull request #4268 from jumpserver/dev_adminuser

fix(assets): 修复测试管理用户/系统用户资产可连接性问题
pull/4270/head
BaiJiangJie 2020-07-08 14:47:09 +08:00 committed by GitHub
commit 452ed2baf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 3 deletions

View File

@ -85,7 +85,7 @@ def test_asset_user_connectivity_util(asset_user, task_name):
raw, summary = test_user_connectivity(
task_name=task_name, asset=asset_user.asset,
username=asset_user.username, password=asset_user.password,
private_key=asset_user.private_key
private_key=asset_user.private_key_file
)
except Exception as e:
logger.warn("Failed run adhoc {}, {}".format(task_name, e))

View File

@ -31,7 +31,10 @@ def test_system_user_connectivity_util(system_user, assets, task_name):
"""
from ops.utils import update_or_create_ansible_task
hosts = clean_ansible_task_hosts(assets, system_user=system_user)
# hosts = clean_ansible_task_hosts(assets, system_user=system_user)
# TODO: 这里不传递系统用户因为clean_ansible_task_hosts会通过system_user来判断是否可以推送
# 不符合测试可连接性逻辑, 后面需要优化此逻辑
hosts = clean_ansible_task_hosts(assets)
if not hosts:
return {}
platform_hosts_map = {}

Binary file not shown.

View File

@ -756,7 +756,7 @@ msgstr "定期测试管理账号可连接性: {}"
#: assets/tasks/admin_user_connectivity.py:67
msgid "Test admin user connectivity: {}"
msgstr "测试管理号可连接性: {}"
msgstr "测试管理号可连接性: {}"
#: assets/tasks/asset_connectivity.py:27
msgid "Test assets connectivity"