[PATCH 1/2] booty: isw_Vol0_Stripe is not a disk isw_Vol0_Stri with an e part (#505205)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 booty/util.py |   27 ++++++++++++++-------------
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/booty/util.py b/booty/util.py
index 4128705..2b79730 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]
 
-- 
1.6.2.2

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux