in tools/torset-tool/torset-tool.py [0:0]
def group_guids_per_switch(self) -> list:
guids_per_switch = []
with open(self.topo_file, 'r') as f:
for line in f:
if 'Nodes=' not in line:
continue
# 'SwitchName=ibsw2 Nodes=0x155dfffd341acb,0x155dfffd341b0b'
guids_per_switch.append(line.strip().split(' ')[1].split('=')[1])
return guids_per_switch