MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pci_glob

Function pci_glob

dpdk/usertools/dpdk-devbind.py:629–638  ·  view source on GitHub ↗

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

(arg)

Source from the content-addressed store, hash-verified

627
628
629def pci_glob(arg):
630 '''Returns a list containing either:
631 * List of PCI B:D:F matching arg, using shell wildcards e.g. 80:04.*
632 * Only the passed arg if matching list is empty'''
633 sysfs_path = "/sys/bus/pci/devices"
634 for _glob in [arg, '0000:' + arg]:
635 paths = [basename(path) for path in glob(path_join(sysfs_path, _glob))]
636 if paths:
637 return paths
638 return [arg]
639
640
641def parse_args():

Callers 1

parse_argsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected