from sys import exit
dict={'5': {'3': 1, '4': 1}, '3': {'5': 1, '2': 1}, '2': {'1': 1, '3': 1}, '1': {'2': 1, '4': 1}, '4': {'1': 1, '5': 1}}
topoResult=[5, 0, 3, 4, 6]
#change node with start number 1
topoNew=[]
#topoNew.append(topoResult[0])
for i in topoResult[1:len(topoResult)-1]:
topoNew.append(i+1)
#topoNew.append(topoResult[len(topoResult)-1])
print(topoNew)
#def getNodePort():
switch_id=2
s="00:00:00:00:00:00:00:{:0>2}".format(switch_id)
print(s)
for k in topoNew:
current=k
print('-current-'+str(current))
for _getInPort in dict[str(k)]:
#print(_getInPort)
if int(_getInPort) in topoNew:
_temp=dict[str(_getInPort)]
inPort=_temp[str(current)]
print('-pair node-'+str(_getInPort)+'-pair node port:'+ str(inPort))
print('-end-')
testtestssss
最新推荐文章于 2024-04-24 13:35:29 发布