From 0def477b63712e79cff36bee5bd21fd17443a48e Mon Sep 17 00:00:00 2001 From: Bai Date: Mon, 2 Aug 2021 16:33:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=94=B6=E9=9B=86wind?= =?UTF-8?q?ows=E8=B5=84=E4=BA=A7=E7=94=A8=E6=88=B7=E6=97=B6=E6=9C=AA?= =?UTF-8?q?=E6=94=B6=E9=9B=86=E5=88=B0=E5=85=A8=E9=83=A8=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/tasks/gather_asset_users.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/assets/tasks/gather_asset_users.py b/apps/assets/tasks/gather_asset_users.py index 0187a29aa..6ff2993d7 100644 --- a/apps/assets/tasks/gather_asset_users.py +++ b/apps/assets/tasks/gather_asset_users.py @@ -60,9 +60,12 @@ def parse_windows_result_to_users(result): task_result.pop() for line in task_result: - user = space.split(line) - if user[0]: - users[user[0]] = {} + username_list = space.split(line) + # such as: ['Admini', 'appadm', 'DefaultAccount', ''] + for username in username_list: + if not username: + continue + users[username] = {} return users