summaryrefslogtreecommitdiffstats
path: root/booty
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2009-08-10 14:37:46 +0200
committerHans de Goede <hdegoede@redhat.com>2009-08-10 14:37:46 +0200
commitec9e957f3425e37cff34722cb6d10378bf454bee (patch)
tree99b9ee89f907b669013f4ce65bfe8e807d508ef1 /booty
parent33dcd9a477b6a47e2a7e135a5d72e4f3cc54070b (diff)
downloadanaconda-ec9e957f3425e37cff34722cb6d10378bf454bee.tar.gz
anaconda-ec9e957f3425e37cff34722cb6d10378bf454bee.tar.xz
anaconda-ec9e957f3425e37cff34722cb6d10378bf454bee.zip
booty: isw_Vol0_Stripe is not a disk isw_Vol0_Stri with an e part (#505205)
This patch fixes the (stupid) traceback in booty/util.py getDiskPart() from 505205, by checking all characters after the cut point are digits before assuming we have found a place to cut between partition number and disk.
Diffstat (limited to 'booty')
-rw-r--r--booty/util.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/booty/util.py b/booty/util.py
index 41287059d..2b7973015 100644
--- a/booty/util.py
+++ b/booty/util.py
@@ -4,19 +4,20 @@ from flags import flags
def getDiskPart(dev, storage):
path = storage.devicetree.getDeviceByName(dev).path[5:]
cut = len(dev)
- if (path.startswith('rd/') or path.startswith('ida/') or
- path.startswith('cciss/') or path.startswith('sx8/') or
- path.startswith('mapper/') or path.startswith('mmcblk') or
- path.startswith('md')):
- if dev[-2] == 'p':
- cut = -1
- elif dev[-3] == 'p':
- cut = -2
- else:
- if dev[-2] in string.digits:
- cut = -2
- elif dev[-1] in string.digits:
- cut = -1
+ if dev[-1] in string.digits:
+ if (path.startswith('rd/') or path.startswith('ida/') or
+ path.startswith('cciss/') or path.startswith('sx8/') or
+ path.startswith('mapper/') or path.startswith('mmcblk') or
+ path.startswith('md')):
+ if dev[-2] == 'p':
+ cut = -1
+ elif dev[-3] == 'p' and dev[-2] in string.digits:
+ cut = -2
+ else:
+ if dev[-2] in string.digits:
+ cut = -2
+ else:
+ cut = -1
name = dev[:cut]