On Fri, May 13, 2011 at 06:00:22PM +0200, Ales Kozumplik wrote: > Before it worked OK for 'mapper/mpath1p2' but it failed to separate the > partition part from 'mapper/rootdevp1' (because the disk part contains no > digits) > > This replaces the ancient part of the method with something simpler and > hopefully more general (though it's hard to say it doesn't brake some > other cases). > --- > bootyutil.py | 10 +++------- > 1 files changed, 3 insertions(+), 7 deletions(-) > > diff --git a/bootyutil.py b/bootyutil.py > index ea48c44..7b06fdb 100644 > --- a/bootyutil.py > +++ b/bootyutil.py > @@ -35,13 +35,9 @@ def getDiskPart(dev): > cut = -1 > > name = dev[:cut] > - > - # hack off the trailing 'p' from /dev/cciss/*, for example > - if name[-1] == 'p': > - for letter in name: > - if letter not in string.letters and letter != "/": > - name = name[:-1] > - break > + if cut < 0 and name[-1] == 'p': > + # hack off the trailing 'p' if we found the partition part > + name = name[:-1] > > if cut < 0: > partNum = int(dev[cut:]) - 1 > -- > 1.7.3.3 I think that looks ok, although that function looks alot more convoluted than it needs to be. -- Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
Attachment:
pgpLPhsoo_HpB.pgp
Description: PGP signature
_______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list