File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 11jc changelog
22
3- 20250414 v1.25.5
3+ 20250503 v1.25.5
44- Add `amixer` command parser
55- Enhance `iptables` command parser to add default policy statistics fields
66- Fix `bluetoothctl` parser failing to parse controllers with power state prop
77- Fix `lsblk` command parser to support multiple mountpoints. Also, added
88 byte conversions for size fields.
9+ - Fix `nmcli` command parser to support `team.config` JSON field
910- Fix `time` command parser for output that does not contain centiseconds
1011- Fix `x509-cert` parser to handle IDNA2008 encoded email addresses with a warning
1112- Fix typing for upcoming python v3.14
Original file line number Diff line number Diff line change 141141 ]
142142"""
143143import re
144+ import json
144145from typing import List , Dict , Optional
145146import jc .utils
146147from jc .parsers .universal import sparse_table_parse
149150
150151class info ():
151152 """Provides parser metadata (version, author, etc.)"""
152- version = '1.0 '
153+ version = '1.1 '
153154 description = '`nmcli` command parser'
154155 author = 'Kelly Brazil'
155156 author_email = 'kellyjonbrazil@gmail.com'
@@ -313,8 +314,29 @@ def _device_show_parse(data: str) -> List[Dict]:
313314def _connection_show_x_parse (data : str ) -> List [Dict ]:
314315 raw_output : List = []
315316 item : Dict = {}
317+ in_team_config : bool = False
318+ team_config_value : List = []
316319
317320 for line in filter (None , data .splitlines ()):
321+
322+ # fix for team.config, which is multi-line JSON
323+ if line .startswith ('team.config:' ):
324+ in_team_config = True
325+ _ , value = line .split (':' , maxsplit = 1 )
326+ team_config_value .append (value .strip ())
327+ item ['team_config' ] = []
328+ continue
329+
330+ if not line .startswith ('team.' ) and in_team_config :
331+ team_config_value .append (line .strip ())
332+ continue
333+
334+ in_team_config = False
335+
336+ if team_config_value :
337+ item ['team_config' ] = json .loads ('' .join (team_config_value ))
338+ team_config_value = []
339+
318340 key , value = line .split (':' , maxsplit = 1 )
319341
320342 key_n = _normalize_key (key )
You can’t perform that action at this time.
0 commit comments