From 781b9acdd6667c88091c53efb9e8b2bf37a4feab Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Mon, 2 Apr 2007 13:51:32 +0000 Subject: [PATCH] Bugfix: * Indentation error made detection of multiple volumes impossible * Unexpected behaviour happened when a device without volume was detected --- tools/pamusb-conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/pamusb-conf b/tools/pamusb-conf index f649c59..61149d7 100755 --- a/tools/pamusb-conf +++ b/tools/pamusb-conf @@ -32,6 +32,8 @@ class Device: self.vendor = deviceProperties['usb_device.vendor'] self.product = deviceProperties['info.product'] self.serialNumber = deviceProperties['usb_device.serial'] + if len(self.volumes()) < 1: + raise Exception, '%s does not contain any volume' % self.__udi def __isChildOfDevice(self, udi): obj = bus.get_object('org.freedesktop.Hal', udi) @@ -66,7 +68,7 @@ class Device: continue vols.append({'uuid' : deviceProperties['volume.uuid'], 'device' : deviceProperties['block.device']}) - return vols + return vols def listOptions(question, options, autodetect = True): if autodetect == True and len(options) == 1: