diff options
| author | ghost <andreas.monzner@multimedia-labs.de> | 2009-01-19 11:12:54 +0100 |
|---|---|---|
| committer | ghost <andreas.monzner@multimedia-labs.de> | 2009-01-19 11:12:54 +0100 |
| commit | 0621e74942fa09f300e8b63d5e586db4575ba180 (patch) | |
| tree | 24f6e495808d8f5407430a3fbf8b5d9d8936151b /lib/python/Components | |
| parent | b37fb8b50e48795882cd933c8ef9fe31b3ef007d (diff) | |
| download | enigma2-0621e74942fa09f300e8b63d5e586db4575ba180.tar.gz enigma2-0621e74942fa09f300e8b63d5e586db4575ba180.zip | |
use OSError instead of IOError and small fix for sr devices
Diffstat (limited to 'lib/python/Components')
| -rw-r--r-- | lib/python/Components/Harddisk.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/python/Components/Harddisk.py b/lib/python/Components/Harddisk.py index 8e30a512..d739e984 100644 --- a/lib/python/Components/Harddisk.py +++ b/lib/python/Components/Harddisk.py @@ -351,12 +351,15 @@ class HarddiskManager: def addHotplugPartition(self, device, physdev = None): if not physdev: dev, part = self.splitDeviceName(device) - physdev = dev try: - import os - physdev = os.readlink("/sys/block/" + dev + "/device")[6:] - except IOError: - print "couldn't determine blockdev physdev for device", dev + physdev = readlink("/sys/block/" + dev + "/device")[6:] + except OSError: + print "couldn't determine blockdev physdev for device", dev, "try", device, "now" + try: + physdev = readlink("/sys/block/" + device + "/device")[6:] + except OSError: + physdev = dev + print "couldn't determine blockdev physdev for device", device # device is the device name, without /dev # physdev is the physical device path, which we (might) use to determine the userfriendly name |
