summaryrefslogtreecommitdiffstats
path: root/partedUtils.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-08-01 20:50:34 +0000
committerJeremy Katz <katzj@redhat.com>2003-08-01 20:50:34 +0000
commitbb03d006c31a574dd45ce5c037887a47cbbd3d32 (patch)
tree712916423ea457c4a66d32e3b2e206833e23338d /partedUtils.py
parent6736806e92ca2e65cf9d9950012b6311b451c2c5 (diff)
downloadanaconda-bb03d006c31a574dd45ce5c037887a47cbbd3d32.tar.gz
anaconda-bb03d006c31a574dd45ce5c037887a47cbbd3d32.tar.xz
anaconda-bb03d006c31a574dd45ce5c037887a47cbbd3d32.zip
do complete upgrade checks for raid and lvm too (#99359)
Diffstat (limited to 'partedUtils.py')
-rw-r--r--partedUtils.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/partedUtils.py b/partedUtils.py
index 413bc5bf1..5f0bded5f 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -452,7 +452,6 @@ def getRedHatReleaseString(mountpoint):
def productMatches(oldproduct, newproduct):
"""Determine if this is a reasonable product to upgrade old product"""
if oldproduct.startswith(newproduct):
- log("old matches new (%s:%s)" %(oldproduct, newproduct))
return 1
productUpgrades = {
@@ -473,12 +472,8 @@ def productMatches(oldproduct, newproduct):
for p in acceptable:
if oldproduct.startswith(p):
- log("old matches acceptable (%s:%s - %s:%s)" %(oldproduct,
- newproduct, p,
- acceptable))
return 1
- log("old doesn't match: (%s:%s)" %(oldproduct,newproduct))
return 0
class DiskSet:
@@ -561,8 +556,13 @@ class DiskSet:
if found:
if os.access (mountpoint + '/etc/fstab', os.R_OK):
- rootparts.append ((dev, fs,
- getRedHatReleaseString(mountpoint)))
+ relstr = getRedHatReleaseString(mountpoint)
+ cmdline = open('/proc/cmdline', 'r').read()
+
+ if ((cmdline.find("upgradeany") != -1) or
+ (upgradeany == 1) or
+ (productMatches(relstr, productName))):
+ rootparts.append ((dev, fs, relstr))
isys.umount(mountpoint)
# now, look for candidate lvm roots
@@ -590,8 +590,13 @@ class DiskSet:
if found:
if os.access (mountpoint + '/etc/fstab', os.R_OK):
- rootparts.append ((dev, fs,
- getRedHatReleaseString(mountpoint)))
+ relstr = getRedHatReleaseString(mountpoint)
+ cmdline = open('/proc/cmdline', 'r').read()
+
+ if ((cmdline.find("upgradeany") != -1) or
+ (upgradeany == 1) or
+ (productMatches(relstr, productName))):
+ rootparts.append ((dev, fs, relstr))
isys.umount(mountpoint)
lvm.vgdeactivate()