From d93be05b1b625b6b33d94bc72a7f4c474109b2e8 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 --- pam_usb/tools/pamusb-conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pam_usb/tools/pamusb-conf b/pam_usb/tools/pamusb-conf index f649c59..61149d7 100755 --- a/pam_usb/tools/pamusb-conf +++ b/pam_usb/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: