Skip to content

Commit a75e2f4

Browse files
committed
fix: add support for parsing usernames with spaces
1 parent 8abc549 commit a75e2f4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

jc/parsers/net_user.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,12 @@ def _parse(data):
425425

426426
if collecting_users:
427427
# Split the line into usernames
428-
users_in_line = line.split()
429-
for username in users_in_line:
430-
user_account = {"user_name": username}
431-
result["user_accounts"].append(user_account)
428+
user_matches = re.match(r'(.{1,20})\s+(.{1,20})\s+(.{1,20})', line)
429+
if user_matches:
430+
for username in user_matches.groups():
431+
username = username.strip()
432+
user_account = {"user_name": username}
433+
result["user_accounts"].append(user_account)
432434
except StopIteration:
433435
break
434436
else:

0 commit comments

Comments
 (0)