提交 0e64999e 编写于 作者: L Lukáš Doktor

utils.pci: Avoid unnecessary match in get_slot_from_sysfs

Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 904d5d94
......@@ -183,11 +183,10 @@ def get_slot_from_sysfs(full_pci_address):
return
slot = genio.read_file("/proc/device-tree/%s/ibm,loc-code" % devspec)
slot_ibm = re.match(r'((\w+)[.])+(\w+)-[P(\d+)-]*C(\d+)', slot)
slot_openpower = re.match(r'(\w+)[\s]*(\w+)(\d*)', slot)
if slot_ibm:
return slot_ibm.group()
else:
return slot_openpower.group()
slot_openpower = re.match(r'(\w+)[\s]*(\w+)(\d*)', slot)
return slot_openpower.group()
def get_slot_list():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册