Move the test for anaconda.intf to the swapErrorDialog() function. If we don't have one, exit (consistent with existing behavior). Simplify the exception handlers that call swapErrorDialog() and remove the tests for anaconda.intf. --- storage/__init__.py | 59 ++++++++++++++++++++++++++------------------------- 1 files changed, 30 insertions(+), 29 deletions(-) diff --git a/storage/__init__.py b/storage/__init__.py index 4399d36..802aef8 100644 --- a/storage/__init__.py +++ b/storage/__init__.py @@ -1585,6 +1585,9 @@ class FSSet(object): def turnOnSwap(self, anaconda, upgrading=None): def swapErrorDialog(msg, device): + if not anaconda.intf: + sys.exit(0) + buttons = [_("Skip"), _("Format"), _("_Exit")] ret = anaconda.intf.messageWindow(_("Error"), msg, type="custom", custom_buttons=buttons, @@ -1618,38 +1621,36 @@ class FSSet(object): device.setup() device.format.setup() except OldSwapError: - if anaconda.intf: + msg = _("The swap device:\n\n %s\n\n" + "is an old-style Linux swap partition. If " + "you want to use this device for swap space, " + "you must reformat as a new-style Linux swap " + "partition.") \ + % device.path + + if swapErrorDialog(msg, device): + continue + except SuspendError: + if upgrading: msg = _("The swap device:\n\n %s\n\n" - "is an old-style Linux swap partition. If " - "you want to use this device for swap space, " - "you must reformat as a new-style Linux swap " - "partition.") \ + "in your /etc/fstab file is currently in " + "use as a software suspend device, " + "which means your system is hibernating. " + "To perform an upgrade, please shut down " + "your system rather than hibernating it.") \ + % device.path + else: + msg = _("The swap device:\n\n %s\n\n" + "in your /etc/fstab file is currently in " + "use as a software suspend device, " + "which means your system is hibernating. " + "If you are performing a new install, " + "make sure the installer is set " + "to format all swap devices.") \ % device.path - if swapErrorDialog(msg, device): - continue - except SuspendError: - if anaconda.intf: - if upgrading: - msg = _("The swap device:\n\n %s\n\n" - "in your /etc/fstab file is currently in " - "use as a software suspend device, " - "which means your system is hibernating. " - "To perform an upgrade, please shut down " - "your system rather than hibernating it.") \ - % device.path - else: - msg = _("The swap device:\n\n %s\n\n" - "in your /etc/fstab file is currently in " - "use as a software suspend device, " - "which means your system is hibernating. " - "If you are performing a new install, " - "make sure the installer is set " - "to format all swap devices.") \ - % device.path - - if swapErrorDialog(msg, device): - continue + if swapErrorDialog(msg, device): + continue except DeviceError as (msg, name): if anaconda.intf: if upgrading: -- 1.6.2.5 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list