提交 3b7484cb 编写于 作者: N Naresh Bannoth

Return slot direct from file output without any filter

Different servers returns the slot numbers in different formate.
So filtering it with regExp may not return correct value.
hence return a slot value directly from file output, and leave
upto the user for rheir usage accordingly.
following are few example of different slot values on different
systems
examples:
root@ltciofvtr-firestone1:~# lsvpd -l 0000:01:00.1 | grep -i "*YL"
*YL Slot5
root@ltciofvtr-firestone1:~#
root@ltc-briggs3:~# lsvpd -l 0004:01:00.1 | grep -i "*YL"
*YL WIO Slot3
root@ltc-briggs3:~#
root@ltcalpine-lp2:~# lsvpd -l 0028:01:00.0 | grep -i "*YL"
*YL U78C7.001.RCH0040-P1-C9-T1
root@ltcalpine-lp2:~#
Signed-off-by: NNaresh Bannoth <nbannoth@in.ibm.com>
上级 c85d8912
......@@ -141,8 +141,7 @@ def get_slot_from_sysfs(full_pci_address):
if not os.path.isfile("/proc/device-tree/%s/ibm,loc-code" % devspec):
return
slot = read_file("/proc/device-tree/%s/ibm,loc-code" % devspec)
return re.match(r'((\w+)[\.])+(\w+)-(\w*\d+)-(\w*\d+)|Slot(\d+)',
slot).group()
return slot
def get_slot_list():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册