File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed
Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -172,14 +172,21 @@ def parse_info(
172172 settings = {}
173173 for item in items :
174174 match = re .search (pattern , item )
175- settings [match .group ("name" ).strip ()] = {
176- "value" : match .group ("value" ),
175+ try :
176+ name = match .group ("name" )
177+ except AttributeError :
178+ _logger .warning (f"Error parsing info. No item name found on: { item } " )
179+ continue
180+ try :
181+ value = match .group ("value" )
182+ except AttributeError :
183+ _logger .warning (f"Error parsing info. No item value found on: { item } " )
184+ continue
185+ settings [name .strip ()] = {
186+ "value" : value ,
177187 "command" : None
178- if not match .group ("command" )
179- else match .group ("command" )[1 :- 1 ],
180- "units" : match .group ("units" )
181- if len (match .group ("units" ))
182- else None ,
188+ if not match .group ("command" ) else match .group ("command" )[1 :- 1 ],
189+ "units" : match .group ("units" ) if len (match .group ("units" )) else None ,
183190 }
184191
185192 return settings
You can’t perform that action at this time.
0 commit comments