diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index d186b53b9..2413e79ef 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -2,6 +2,8 @@ ## [UNRELEASED] +- Ensure that the variable designating a switch as primary is always initialized. + ## [1.8.0] - Move NMN/HMN/MTL to new vrf, move CMN/CHN/CAN to default vrf. diff --git a/canu/generate/switch/config/config.py b/canu/generate/switch/config/config.py index 289371106..491bc4a0f 100644 --- a/canu/generate/switch/config/config.py +++ b/canu/generate/switch/config/config.py @@ -1519,9 +1519,10 @@ def get_switch_nodes( } nodes.append(new_node) elif shasta_name == "sw-spine": + is_primary, primary, secondary = switch_is_primary(switch_name) + # sw-leaf ==> sw-spine if switch_name.startswith("sw-leaf"): - is_primary, primary, secondary = switch_is_primary(switch_name) digits = re.findall(r"(\d+)", primary)[0] lag_number = 100 + int(digits) @@ -1539,10 +1540,8 @@ def get_switch_nodes( # sw-spine ==> sw-spine elif switch_name.startswith("sw-spine"): - is_primary, primary, secondary = switch_is_primary(switch_name) lag_number = 256 elif switch_name.startswith("sw-edge"): - is_primary, primary, secondary = switch_is_primary(switch_name) lag_number = 250 new_node = { "subtype": "spine",