[PATCH] Don't traceback if there are no partitioned device (#1007683)

David Lehman dlehman at redhat.com
Mon Oct 14 20:33:40 UTC 2013


On Mon, 2013-10-14 at 21:35 +0200, Martin Kolman wrote:
> Signed-off-by: Martin Kolman <mkolman at redhat.com>
> ---
>  iw/partition_gui.py | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/iw/partition_gui.py b/iw/partition_gui.py
> index 3751c5e..8cf9ca3 100644
> --- a/iw/partition_gui.py
> +++ b/iw/partition_gui.py
> @@ -1570,11 +1570,17 @@ class PartitionWindow(InstallWindow):
>          """ createCB wrapper
>  
>          Blocks and unblocks handlers for the other buttons """
> -
> -        self._blockButtonHandlers("create")
> -        gui.processEvents()
> -        self.createCB(*args)
> -        self._unblockButtonHandlers("create")
> +        # only activate the create dialog if there are
> +        # partioned devices
> +        if not self.storage.partitioned:
> +            self.intf.messageWindow(_("Error Partitioning"),
> +                                    _("No partitioned disks found."),
> +                                    custom_icon="error")
> +        else:
> +            self._blockButtonHandlers("create")
> +            gui.processEvents()
> +            self.createCB(*args)
> +            self._unblockButtonHandlers("create")

I think instead of this what you want to do is manipulate
activate_create_partition in createCB. That way it will be possible to
create other types of devices if, for example, all disks are
unpartitioned LVM PVs and the user only wants to create new LVs.

>  
>      def resetCB(self, *args):
>          if not confirmResetPartitionState(self.intf):




More information about the anaconda-patches mailing list