Skip to content

Commit 9037039

Browse files
sdszhangbachalla
authored andcommitted
update quicksilver TH5-512 port name (sonic-net#18600)
What is the motivation for this PR? update sonic-mgmt to match with the new naming convention after sonic-net/sonic-buildimage#22577
1 parent 114e770 commit 9037039

1 file changed

Lines changed: 19 additions & 9 deletions

File tree

ansible/module_utils/port_utils.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,29 @@ def get_port_alias_to_name_map(hwsku, asic_name=None):
150150
port_alias_to_name_map["Ethernet65"] = "Ethernet512"
151151
port_alias_to_name_map["Ethernet66"] = "Ethernet513"
152152
elif hwsku == "Arista-7060X6-64PE-B-C512S2":
153+
split_alias_list = ["a", "b", "c", "d", "e", "f", "g", "h"]
153154
for i in range(1, 65):
154-
for j in range(1, 9):
155-
port_alias_to_name_map["Ethernet%d/%d" % (i, j)] = "Ethernet%d" % ((i - 1) * 8 + j - 1)
156-
port_alias_to_name_map["Ethernet65"] = "Ethernet512"
157-
port_alias_to_name_map["Ethernet66"] = "Ethernet513"
155+
for idx, split_alias in enumerate(split_alias_list):
156+
alias = "etp{}{}".format(i, split_alias)
157+
eth_name = "Ethernet{}".format((i - 1) * 8 + idx)
158+
port_alias_to_name_map[alias] = eth_name
159+
port_alias_to_name_map['etp65'] = "Ethernet512"
160+
port_alias_to_name_map['etp66'] = "Ethernet513"
158161
elif hwsku == "Arista-7060X6-64PE-B-C448O16":
162+
split_alias_list = ["a", "b", "c", "d", "e", "f", "g", "h"]
163+
split_alias_list_1 = ["a", "b"]
164+
split_2_port_indexs = [13, 14, 17, 18, 45, 46, 49, 50]
159165
for i in range(1, 65):
160-
if i in [13, 14, 17, 18, 45, 46, 49, 50]:
161-
for j in [1, 5]:
162-
port_alias_to_name_map["Ethernet%d/%d" % (i, j)] = "Ethernet%d" % ((i - 1) * 8 + j - 1)
166+
if i in split_2_port_indexs:
167+
for idx, split_alias in enumerate(split_alias_list_1):
168+
alias = "etp{}{}".format(i, split_alias)
169+
eth_name = "Ethernet{}".format((i - 1) * 8 + idx * 4)
170+
port_alias_to_name_map[alias] = eth_name
163171
else:
164-
for j in range(1, 9):
165-
port_alias_to_name_map["Ethernet%d/%d" % (i, j)] = "Ethernet%d" % ((i - 1) * 8 + j - 1)
172+
for idx, split_alias in enumerate(split_alias_list):
173+
alias = "etp{}{}".format(i, split_alias)
174+
eth_name = "Ethernet{}".format((i - 1) * 8 + idx)
175+
port_alias_to_name_map[alias] = eth_name
166176
elif hwsku == "Arista-7050QX32S-Q32":
167177
for i in range(5, 29):
168178
port_alias_to_name_map["Ethernet%d/1" % i] = "Ethernet%d" % ((i - 5) * 4)

0 commit comments

Comments
 (0)