Skip to content

Commit 51406ae

Browse files
authored
fix(yum): keep int defaults when string_table is shorter than 4 lines (#117)
Restores the int=-1 defaults on Section by replacing None values at construction time. Fixes the TypeError regression introduced when IndexError started being caught (#109 fix). Closes #115
1 parent a671f45 commit 51406ae

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • mkp/local/lib/python3/cmk_addons/plugins/yum/agent_based

mkp/local/lib/python3/cmk_addons/plugins/yum/agent_based/yum.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ def yum_parse(string_table: List[List[str]]) -> Section:
9393

9494
return Section(
9595
reboot_required,
96-
packages,
96+
packages if packages is not None else -1,
9797
locked_packages_list,
98-
security_packages,
98+
security_packages if security_packages is not None else -1,
9999
security_packages_list,
100-
last_update_timestamp)
100+
last_update_timestamp if last_update_timestamp is not None else -1)
101101

102102

103103
agent_section_yum = AgentSection(

0 commit comments

Comments
 (0)