Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion avocado/utils/pci.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ def get_slot_from_sysfs(full_pci_address):

:return: Removed port related details using re, only returns till
physical slot of the adapter.
Examples::

U78CC.001.FZHAK92-P2-C3
U50EE.001.WZS0011-P3-C20-R2
"""
if not os.path.isfile(f"/sys/bus/pci/devices/{full_pci_address}/devspec"):
return None
Expand All @@ -201,7 +205,7 @@ def get_slot_from_sysfs(full_pci_address):
if not os.path.isfile(f"/proc/device-tree/{devspec}/ibm,loc-code"):
return None
slot = genio.read_file(f"/proc/device-tree/{devspec}/ibm,loc-code")
slot_ibm = re.match(r"((\w+)[.])+(\w+)-[PC(\d+)-]*C(\d+)", slot)
slot_ibm = re.match(r"((\w+)[.])+(\w+)-[PC(\d+)-]*C(\d+)(?:-R\d+)?", slot)
if slot_ibm:
return slot_ibm.group()
slot_openpower = re.match(r"(\w+)[\s]*(\w+)(\d*)", slot)
Expand Down
Loading