From 0e10d136ef280ca147b6f1e332072f6ba14c8844 Mon Sep 17 00:00:00 2001 From: Yuriy Andamasov Date: Tue, 30 Jun 2026 14:18:50 +0300 Subject: T8522: fix parse_icmp_attr() split delimiter and UnboundLocalError (#464) * Add easy-wins improvement spec for vyos.vyos collection Covers five phases: formatting compliance, runtime.yml redirect fix, deprecated feature cleanup, missing unit tests, and template deduplication. Co-Authored-By: Claude Opus 4.6 (1M context) * Add implementation plan for easy-wins improvements 15 tasks across 5 phases: formatting compliance, runtime.yml bugfix, deprecated code cleanup, missing unit tests, template deduplication. Co-Authored-By: Claude Opus 4.6 (1M context) * Update spec and plan with architect review corrections Key changes: - Defer Phase 5 (template deduplication) to v7.0.0: route_maps are not identical, BGP dedup blocked by Python module-level scoping, OSPF has fundamentally different command paradigms - Add .git-blame-ignore-revs step to Phase 1 - Add missing test cases: overridden/rendered for resource modules, aggregate/purge/with_address for vyos_vlan - Fix incorrect claim that version.py LooseVersion is unused - Add sequential merge requirement to preamble Co-Authored-By: Claude Opus 4.6 (1M context) * chore: add .worktrees/ and .claude/ to .gitignore * T8522: fix parse_icmp_attr() split delimiter and UnboundLocalError - Use val.split("/") instead of val.split(".") when parsing type/code pairs - In the numeric-only branch, use int(val) instead of the undefined type_no variable - Cast both type and code to int for consistent typing Co-Authored-By: Claude Sonnet 4.6 * T8522: remove unrelated planning docs and gitignore changes These files were included from local main branch commits unrelated to this bugfix. This commit removes them to keep the PR scoped. Co-Authored-By: Claude Sonnet 4.6 * T8522: add parsed test for legacy type/code ICMP format Co-Authored-By: Claude Sonnet 4.6 --------- Co-authored-by: Claude Opus 4.6 (1M context) Co-authored-by: omnom62 <75066712+omnom62@users.noreply.github.com> --- .../network/vyos/facts/firewall_rules/firewall_rules.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/module_utils') diff --git a/plugins/module_utils/network/vyos/facts/firewall_rules/firewall_rules.py b/plugins/module_utils/network/vyos/facts/firewall_rules/firewall_rules.py index 270b4a62..f8f02e7a 100644 --- a/plugins/module_utils/network/vyos/facts/firewall_rules/firewall_rules.py +++ b/plugins/module_utils/network/vyos/facts/firewall_rules/firewall_rules.py @@ -412,11 +412,11 @@ class Firewall_rulesFacts(object): # <1.3 could be # (type), #/# (type/code) or 'type' (type_name) # recent this is only for strings if "/" in val: # type/code - (type_no, code) = val.split(".") - config["type"] = type_no - config["code"] = code + (type_no, code) = val.split("/") + config["type"] = int(type_no) + config["code"] = int(code) elif val.isnumeric(): - config["type"] = type_no + config["type"] = int(val) else: config["type_name"] = val return config -- cgit v1.2.3