Skip to content

Commit

Permalink
Merge branch 'sonic-net:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sempSONiC2 authored Jul 12, 2023
2 parents 68b7d72 + 553a343 commit c6e8f8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions scripts/route_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,12 @@ def get_soc_ips(config_db):
mux_table = config_db.get_table('MUX_CABLE')
soc_ips = []
for _, mux_entry in mux_table.items():
if mux_entry.get("cable_type", "") == "active-active" and "soc_ipv4" in mux_entry:
soc_ips.append(mux_entry["soc_ipv4"])
if mux_entry.get("cable_type", "") == "active-active":
if "soc_ipv4" in mux_entry and mux_entry["soc_ipv4"]:
soc_ips.append(mux_entry["soc_ipv4"])

if "soc_ipv6" in mux_entry and mux_entry["soc_ipv6"]:
soc_ips.append(mux_entry["soc_ipv6"])

return soc_ips

Expand Down
4 changes: 3 additions & 1 deletion tests/route_check_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@
"server_ipv4": "192.168.0.2/32",
"server_ipv6": "fc02:1000::2/128",
"soc_ipv4": "192.168.0.3/32",
"soc_ipv6": "fc02:1000::3/128",
"state": "auto"
},
}
Expand All @@ -356,7 +357,8 @@
RT_ENTRY_TABLE: {
RT_ENTRY_KEY_PREFIX + "192.168.0.2/32" + RT_ENTRY_KEY_SUFFIX: {},
RT_ENTRY_KEY_PREFIX + "fc02:1000::2/128" + RT_ENTRY_KEY_SUFFIX: {},
RT_ENTRY_KEY_PREFIX + "192.168.0.3/32" + RT_ENTRY_KEY_SUFFIX: {}
RT_ENTRY_KEY_PREFIX + "192.168.0.3/32" + RT_ENTRY_KEY_SUFFIX: {},
RT_ENTRY_KEY_PREFIX + "fc02:1000::3/128" + RT_ENTRY_KEY_SUFFIX: {}
}
}
}
Expand Down

0 comments on commit c6e8f8f

Please sign in to comment.