[Mellanox][Pcie] Fix issue on pcied with an id that contains only decimal digits was treated as a decimal number (#8309)

A device that contains only decimal digits was mistreated as a decimal integer resulting in failure to find it in the id to bus map.
This commit is contained in:
DavidZagury 2021-08-04 01:25:28 +03:00 committed by Judy Joseph
parent 8093ab2024
commit 03da44aea6

View File

@ -26,7 +26,7 @@ class Pcie(PcieUtil):
id_conf = item_conf["id"]
dev_conf = item_conf["dev"]
fn_conf = item_conf["fn"]
bus_conf = self._device_id_to_bus_map.get(id_conf)
bus_conf = self._device_id_to_bus_map.get(str(id_conf))
if bus_conf and self.check_pcie_sysfs(bus=int(bus_conf, base=16), device=int(dev_conf, base=16),
func=int(fn_conf, base=16)):
item_conf["result"] = "Passed"