in tools/torset-tool/torset-tool.py [0:0]
def retrieve_guids(self, private_key) -> dict:
cmd = 'ibstatus | grep mlx5_ib | cut -d" " -f3 | xargs -I% ibstat "%" | grep "Port GUID" | cut -d: -f2'
with open(self.hosts_file, 'r') as f:
hosts = [host.strip() for host in f.readlines()]
output = run_parallel_cmd(hosts, private_key, cmd)
for host_out in output:
for guid in host_out.stdout:
# Querying GUIDs from ibstat will have pattern 0x0099999999999999, but Sharp will return 0x99999999999999
# - So we need to remove the leading 00 after 0x
self.guid_to_host_map[guid.replace('0x00', '0x').strip()]=host_out.host