Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[minigraph.py]: Don't create mux table entries for servers w/o loopbacks #6457

Merged
merged 1 commit into from
Jan 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/sonic-config-engine/minigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1506,14 +1506,17 @@ def get_mux_cable_entries(mux_cable_ports, neighbors, devices):
neighbor = neighbors[intf]['name']
entry['state'] = 'auto'

# Always force a /32 prefix for server IPv4 loopbacks
server_ipv4_lo_addr = devices[neighbor]['lo_addr'].split("/")[0]
server_ipv4_lo_prefix = ipaddress.ip_network(UNICODE_TYPE(server_ipv4_lo_addr))
entry['server_ipv4'] = str(server_ipv4_lo_prefix)

if 'lo_addr_v6' in devices[neighbor]:
entry['server_ipv6'] = devices[neighbor]['lo_addr_v6']
mux_cable_table[intf] = entry
if devices[neighbor]['lo_addr'] is not None:
# Always force a /32 prefix for server IPv4 loopbacks
server_ipv4_lo_addr = devices[neighbor]['lo_addr'].split("/")[0]
server_ipv4_lo_prefix = ipaddress.ip_network(UNICODE_TYPE(server_ipv4_lo_addr))
entry['server_ipv4'] = str(server_ipv4_lo_prefix)

if 'lo_addr_v6' in devices[neighbor]:
entry['server_ipv6'] = devices[neighbor]['lo_addr_v6']
mux_cable_table[intf] = entry
else:
print("Warning: no server IPv4 loopback found for {}, skipping mux cable table entry".format(neighbor))

return mux_cable_table

Expand Down