summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2012-10-12 13:30:43 -0400
committerChris Lumens <clumens@redhat.com>2012-10-15 10:24:45 -0400
commitbfc36eebfd56aad010964f63b9d76e75f520d546 (patch)
tree43cb781123f35041dedb195c0bbd2ff9091843e3
parentbd7ef40fb30b54167097866e6f8fcaa5ffa4cc77 (diff)
downloadanaconda-bfc36eebfd56aad010964f63b9d76e75f520d546.tar.gz
anaconda-bfc36eebfd56aad010964f63b9d76e75f520d546.tar.xz
anaconda-bfc36eebfd56aad010964f63b9d76e75f520d546.zip
Don't traceback when removing a mountpoint with no expanded selector (#862746).
Most of this patch is just un-indenting stuff. The rest is replacing references to currentPage with references to selector._root. Same data, really.
-rw-r--r--pyanaconda/ui/gui/spokes/custom.py67
1 files changed, 35 insertions, 32 deletions
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index b47e76d31..3150f6d25 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1679,42 +1679,45 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._current_selector = None
def on_remove_clicked(self, button):
- page = self._accordion.currentPage()
- log.info("on_remove_clicked: %s" % page.pageTitle)
+ # Nothing displayed on the RHS? Nothing to remove.
+ if not self._current_selector:
+ return
- if self._current_selector:
- device = self._current_selector._device
- log.debug("removing device '%s' from page %s" % (device,
- page.pageTitle))
- if page.pageTitle == new_install_name:
- if device.exists:
- # This is an existing device that was added to the new page.
- # All we want to do is revert any changes to the device and
- # it will end up back in whatever old pages it came from.
- with ui_storage_logger():
- self.__storage.resetDevice(device)
-
- log.debug("updated device: %s" % device)
- else:
- # Destroying a non-existing device doesn't require any
- # confirmation.
- self._destroy_device(device)
- else:
- # This is a device that exists on disk and most likely has data
- # on it. Thus, we first need to confirm with the user and then
- # schedule actions to delete the thing.
- dialog = ConfirmDeleteDialog(self.data)
- with enlightbox(self.window, dialog.window):
- dialog.refresh(getattr(device.format, "mountpoint", ""),
- device.name)
- rc = dialog.run()
-
- if rc == 0:
- return
+ selector = self._current_selector
+ log.info("on_remove_clicked: %s" % selector._root.name)
+
+ device = self._current_selector._device
+ log.debug("removing device '%s' from page %s" % (device, selector._root.name))
+
+ if selector._root.name == new_install_name:
+ if device.exists:
+ # This is an existing device that was added to the new page.
+ # All we want to do is revert any changes to the device and
+ # it will end up back in whatever old pages it came from.
+ with ui_storage_logger():
+ self.__storage.resetDevice(device)
+ log.debug("updated device: %s" % device)
+ else:
+ # Destroying a non-existing device doesn't require any
+ # confirmation.
self._destroy_device(device)
+ else:
+ # This is a device that exists on disk and most likely has data
+ # on it. Thus, we first need to confirm with the user and then
+ # schedule actions to delete the thing.
+ dialog = ConfirmDeleteDialog(self.data)
+ with enlightbox(self.window, dialog.window):
+ dialog.refresh(getattr(device.format, "mountpoint", ""),
+ device.name)
+ rc = dialog.run()
+
+ if rc == 0:
+ return
+
+ self._destroy_device(device)
- log.info("ui: removed device %s" % device.name)
+ log.info("ui: removed device %s" % device.name)
# Now that devices have been removed from the installation root,
# refreshing the display will have the effect of making them disappear.