+
+def pci_glob(arg):
+ '''Returns a list containing either:
+ * List of PCI B:D:F matching arg, using shell wildcards e.g. 80:04.*
+ * Only the passed arg if matching list is empty'''
+ sysfs_path = "/sys/bus/pci/devices"
+ for _glob in [arg, '0000:' + arg]:
+ paths = [basename(path) for path in glob(path_join(sysfs_path, _glob))]
+ if paths:
+ return paths
+ return [arg]
+
+