summaryrefslogtreecommitdiffstats
path: root/bootloader.py
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2001-10-30 19:23:17 +0000
committerMatt Wilson <msw@redhat.com>2001-10-30 19:23:17 +0000
commit607e0fd8bacb9feb9350a62f322900404e0e7b55 (patch)
treed92582d7296bc2592e4c6b50674c2f23ca122762 /bootloader.py
parentfd95f5f5980b8491d212535db79d4375a786d9b0 (diff)
downloadanaconda-607e0fd8bacb9feb9350a62f322900404e0e7b55.tar.gz
anaconda-607e0fd8bacb9feb9350a62f322900404e0e7b55.tar.xz
anaconda-607e0fd8bacb9feb9350a62f322900404e0e7b55.zip
use startswith
Diffstat (limited to 'bootloader.py')
-rw-r--r--bootloader.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/bootloader.py b/bootloader.py
index 2dcab5388..e609db94f 100644
--- a/bootloader.py
+++ b/bootloader.py
@@ -367,7 +367,8 @@ class ia64BootloaderInfo(bootloaderInfo):
bootdisk = bootdev[:ind]
bootpart = bootdev[ind:]
- if bootdisk[0:4] == "ida/" or bootdisk[0:6] == "cciss/" or bootdisk[0:3] == "rd/":
+ if (bootdisk.startswith('ida/') or bootdisk.startswith('cciss/') or
+ bootdisk.startswith('rd/')):
bootdisk = bootdisk[:-1]
self.removeOldEfiEntries(instRoot)
@@ -434,7 +435,7 @@ class x86BootloaderInfo(bootloaderInfo):
grubTarget = bl.getDevice()
# XXX wouldn't it be nice if grub really understood raid? :)
- if grubTarget[:2] == "md":
+ if grubTarget.startswith('md'):
device = fsset.getEntryByDeviceName(grubTarget).device.members[0]
(grubTarget, None) = getDiskPart(device)
@@ -785,7 +786,8 @@ def makeInitrd (kernelTag, instRoot):
# return (disk, partition number) eg ('hda', 1)
def getDiskPart(dev):
cut = len(dev)
- if dev[:3] == "rd/" or dev[:4] == "ida/" or dev[:6] == "cciss/":
+ if (dev.startswith('rd/') or dev.startswith('ida/') or
+ dev.startswith('cciss/')):
if dev[-2] == 'p':
cut = -1
elif dev[-3] == 'p':