summaryrefslogtreecommitdiffstats
path: root/gui.py
diff options
context:
space:
mode:
authorRadek Vykydal <rvykydal@redhat.com>2010-01-07 09:59:32 +0100
committerRadek Vykydal <rvykydal@redhat.com>2010-01-07 09:59:32 +0100
commit5c7b6ee2035626027893cd4d890b9469a0aa2168 (patch)
tree2249590ed77b24d443f91cb10082b3e771970d6b /gui.py
parent31d5b8f4fec513e4f8e246e47e9fee75c701d07b (diff)
downloadanaconda-5c7b6ee2035626027893cd4d890b9469a0aa2168.tar.gz
anaconda-5c7b6ee2035626027893cd4d890b9469a0aa2168.tar.xz
anaconda-5c7b6ee2035626027893cd4d890b9469a0aa2168.zip
Ask about LVM inconsistencies only in storageinit step.
The patch does essentially the same thing as commit 31d5b8f4fec513e4f8e246e47e9fee75c701d07b for disk initialization question. The difference is that when user chooses LVM reinitialization, it is done immediately (not as planned action as with disk initialization) so the user wouldn't be asked again anyway without the patch (he would be asked if he chose to ignore). I also made one function more readable in the patch.
Diffstat (limited to 'gui.py')
-rwxr-xr-xgui.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/gui.py b/gui.py
index 2f9f9258c..ea83c0837 100755
--- a/gui.py
+++ b/gui.py
@@ -988,6 +988,7 @@ class InstallInterface:
cursor = gtk.gdk.Cursor(gtk.gdk.LEFT_PTR)
root.set_cursor(cursor)
self._initLabelAnswers = {}
+ self._inconsistentLVMAnswers = {}
def __del__ (self):
pass
@@ -1160,6 +1161,50 @@ class InstallInterface:
self._initLabelAnswers[path] = retVal
return retVal
+ def resetReinitInconsistentLVMQuestion(self):
+ self._inconsistentLVMAnswers = {}
+
+ def questionReinitInconsistentLVM(self, pv_names=None, lv_name=None, vg_name=None):
+
+ retVal = False # The less destructive default
+
+ if not pv_names or (lv_name is None and vg_name is None):
+ return retVal
+
+ # We are caching answers so that we don't ask for ignoring
+ # in each storage.reset() again (note that reinitialization is
+ # done right after confirmation in dialog, not as a planned
+ # action).
+ key = frozenset(pv_names)
+ if key in self._inconsistentLVMAnswers:
+ log.info("UI not asking about disk initialization, "
+ "using cached answer: %s" % self._inconsistentLVMAnswers[key])
+ return self._inconsistentLVMAnswers[key]
+
+ if vg_name is not None:
+ message = "Volume Group %s" % vg_name
+ elif lv_name is not None:
+ message = "Logical Volume %s" % lv_name
+
+ na = {'msg': message, 'pvs': ", ".join(pv_names)}
+ rc = self.messageWindow(_("Warning"),
+ _("Error processing LVM.\n"
+ "There is inconsistent LVM data on %(msg)s. You can "
+ "reinitialize all related PVs (%(pvs)s) which will erase "
+ "the LVM metadata, or ignore which will preserve the "
+ "contents.") % na,
+ type="custom",
+ custom_buttons = [ _("_Ignore"),
+ _("_Re-initialize") ],
+ custom_icon="question")
+ if rc == 0:
+ pass
+ else:
+ retVal = True # this means clobber.
+
+ self._inconsistentLVMAnswers[key] = retVal
+ return retVal
+
def beep(self):
gtk.gdk.beep()