]> git.ipfire.org Git - oddments/fireinfo.git/commitdiff
Fix error if no USB subsystem is available.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 12 Dec 2010 20:16:49 +0000 (21:16 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 12 Dec 2010 20:16:49 +0000 (21:16 +0100)
fireinfo/system.py

index 01c1990c93a69d5472c560d02f592f74e094102e..ce0efc71ccf9de95ddf05fd80b6761a91c295216 100644 (file)
@@ -303,6 +303,9 @@ class System(object):
                toscan = (("/sys/bus/pci/devices", device.PCIDevice),
                ("/sys/bus/usb/devices", device.USBDevice))
                for path, cls in toscan:
+                       if not os.path.exists(path):
+                               continue
+
                        dirlist = os.listdir(path)
                        for dir in dirlist:
                                self.devices.append(cls(os.path.join(path, dir)))