The attached patch updates findExistingRootPartitions to return dev, fs,
release string, label and uuid and fixes all callers to use the 5 tuple.
This is required so that later changes to upgrades functionality can fit better
in the code. For more background see:
https://www.redhat.com/archives/anaconda-devel-list/2008-December/msg00210.html
Review and comments are appreciated.
Regards,
Alexander.
iw/examine_gui.py | 2 +-
partedUtils.py | 11 +++++++----
rescue.py | 2 +-
textw/upgrade_text.py | 2 +-
upgrade.py | 2 +-
5 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/iw/examine_gui.py b/iw/examine_gui.py
index ca49e3a..63abbad 100644
--- a/iw/examine_gui.py
+++ b/iw/examine_gui.py
@@ -123,7 +123,7 @@ class UpgradeExamineWindow (InstallWindow):
self.upgradecombo.pack_start(cell, True)
self.upgradecombo.set_attributes(cell, markup=0)
- for (part, filesystem, desc, label) in self.parts:
+ for (part, filesystem, desc, label, uuid) in self.parts:
iter = model.append()
if (desc is None) or len(desc) < 1:
desc = _("Unknown Linux system")
diff --git a/partedUtils.py b/partedUtils.py
index ea6f4a0..2fc553c 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -801,8 +801,9 @@ class DiskSet:
except:
label = None
+ uuid = isys.readFSUuid(theDev)
# XXX we could add the "raw" dev and let caller decrypt
- rootparts.append ((theDev, fs, relstr, label))
+ rootparts.append ((theDev, fs, relstr, label, uuid))
isys.umount(self.anaconda.rootPath)
# now, look for candidate lvm roots
@@ -846,8 +847,9 @@ class DiskSet:
label = isys.readFSLabel(theDev)
except:
label = None
-
- rootparts.append ((theDev, fs, relstr, label))
+
+ uuid = isys.readFSUuid(theDev)
+ rootparts.append ((theDev, fs, relstr, label, uuid))
isys.umount(self.anaconda.rootPath)
lvm.vgdeactivate()
@@ -910,8 +912,9 @@ class DiskSet:
except:
label = None
+ uuid = isys.readFSUuid("/dev/%s" % (theDev,))
rootparts.append (("/dev/%s" % (theDev,),
- fstype, relstr, label))
+ fstype, relstr, label, uuid))
isys.umount(self.anaconda.rootPath)
diff --git a/rescue.py b/rescue.py
index 67d573b..2ae35e6 100644
--- a/rescue.py
+++ b/rescue.py
@@ -265,7 +265,7 @@ def runRescue(anaconda, instClass):
scroll = 0
partList = []
- for (drive, fs, relstr, label) in disks:
+ for (drive, fs, relstr, label, uuid) in disks:
if label:
partList.append("%s (%s)" % (drive, label))
else:
diff --git a/textw/upgrade_text.py b/textw/upgrade_text.py
index df79148..34c0823 100644
--- a/textw/upgrade_text.py
+++ b/textw/upgrade_text.py
@@ -212,7 +212,7 @@ class UpgradeExamineWindow:
else:
default = 0
- for (drive, fs, desc, label) in parts:
+ for (drive, fs, desc, label, uuid) in parts:
if drive[:5] != "/dev/":
devname = "/dev/" + drive
else:
diff --git a/upgrade.py b/upgrade.py
index 4aee58c..43b66f6 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -129,7 +129,7 @@ def findRootParts(anaconda):
anaconda.id.rootParts = findExistingRoots(anaconda)
anaconda.id.upgradeRoot = []
- for (dev, fs, meta, label) in anaconda.id.rootParts:
+ for (dev, fs, meta, label, uuid) in anaconda.id.rootParts:
anaconda.id.upgradeRoot.append( (dev, fs) )
if anaconda.id.rootParts is not None and len(anaconda.id.rootParts) > 0:
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list