[PATCH] Fix traceback in second editing of existing raid dev (#497234).

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

 



This only fixes the traceback, but not the deeper cause which
is that we are not editing original format request, but our last
request (edit), so e.g. in 2nd edit "Original filesystem type"
label and "Migrate" option are wrong (reflecting our last
request, not the original format). I added some more conditions
so that we do not display the info and do not offer migration
in such cases. Note that the checks also affect non-raid
existing partition editing in the same sense. The conditions
should be kept when the behavior is fixed.
---
 iw/partition_ui_helpers_gui.py |    4 ++--
 iw/raid_dialog_gui.py          |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/iw/partition_ui_helpers_gui.py b/iw/partition_ui_helpers_gui.py
index 1ff2d5f..f73903e 100644
--- a/iw/partition_ui_helpers_gui.py
+++ b/iw/partition_ui_helpers_gui.py
@@ -337,7 +337,7 @@ def createPreExistFSOptionSection(origrequest, maintable, row, mountCombo,
     # this gets added to the table a bit later on
     lukscb = gtk.CheckButton(_("_Encrypt"))
 
-    if origfs.migratable:
+    if origfs.migratable and origfs.exists:
         migratecb = gtk.CheckButton(label=_("Mi_grate filesystem to:"))
         if formatcb is not None:
             migratecb.set_active(origfs.migrate and (not formatcb.get_active()))
@@ -367,7 +367,7 @@ def createPreExistFSOptionSection(origrequest, maintable, row, mountCombo,
                          (fstypeCombo, mountCombo, origfs, lukscb,
                           migfstypeCombo, migratecb, FLAG_FORMAT))
 
-    if origrequest.resizable:
+    if origrequest.resizable and origfs.exists:
         resizecb = gtk.CheckButton(label=_("_Resize"))
         resizecb.set_active(origfs.resizable and \
                             (origfs.currentSize != origfs.targetSize) and \
diff --git a/iw/raid_dialog_gui.py b/iw/raid_dialog_gui.py
index 652a050..49626c3 100644
--- a/iw/raid_dialog_gui.py
+++ b/iw/raid_dialog_gui.py
@@ -384,7 +384,7 @@ class RaidEditor:
 	    lbl.set_mnemonic_widget(self.fstypeCombo)
             maintable.attach(self.fstypeCombo, 1, 2, row, row + 1)
             row += 1
-        else:
+        elif format.exists:
             maintable.attach(createAlignedLabel(_("Original File System Type:")),
                              0, 1, row, row + 1)
             if format.type:
@@ -490,7 +490,7 @@ class RaidEditor:
 	# format or not?
 	self.formatButton = None
 	self.fsoptionsDict = {}
-	if not format.exists:
+	if not format.exists and not origrequest.exists:
 	    self.formatButton = gtk.CheckButton(_("_Format partition?"))
 	    if not format.type:
 		self.formatButton.set_active(1)
-- 
1.5.4.3

_______________________________________________
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