diff --git a/system/setup b/system/setup index 9ad6c7edf1a..292496b6d0f 100644 --- a/system/setup +++ b/system/setup @@ -633,7 +633,7 @@ class LinuxHardware(Hardware): self.facts['devices'] = {} lspci = module.get_bin_path('lspci') if lspci: - rc, pcidata, err = module.run_command(lspci) + rc, pcidata, err = module.run_command([lspci, '-D']) else: pcidata = None @@ -704,7 +704,9 @@ class LinuxHardware(Hardware): d['size'] = module.pretty_bytes(float(d['sectors']) * float(d['sectorsize'])) d['host'] = "" - m = re.match(".+/[a-f0-9]+:([a-f0-9]+:[a-f0-9]+\.[a-f0-9]+)/host\d+/", sysdir) + + # domains are numbered (0 to ffff), bus (0 to ff), slot (0 to 1f), and function (0 to 7). + m = re.match(".+/([a-f0-9]{4}:[a-f0-9]{2}:[0|1][a-f0-9]\.[0-7])/", sysdir) if m and pcidata: pciid = m.group(1) did = re.escape(pciid)