Skip to content

Commit

Permalink
[Mellanox][Pcie] Fix issue on pcied with an id that contains only dec…
Browse files Browse the repository at this point in the history
…imal 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.
  • Loading branch information
DavidZagury authored Aug 3, 2021
1 parent 4268662 commit d26307d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platform/mellanox/mlnx-platform-api/sonic_platform/pcie.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_pcie_check(self):
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"
Expand Down

0 comments on commit d26307d

Please sign in to comment.