Re: [PATCH] Raise message, not exception when size set in LV dialog is too big.

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

 



It should probably raise the exception again after the message or do something else to prevent the flow to continue, because after the message the templv.size is not set to anything sane..

Martin

----- "Radek Vykydal" <rvykydal@xxxxxxxxxx> wrote:

> ---
>  iw/lvm_dialog_gui.py |   13 ++++++++++++-
>  1 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/iw/lvm_dialog_gui.py b/iw/lvm_dialog_gui.py
> index 9a9566a..f0b2702 100644
> --- a/iw/lvm_dialog_gui.py
> +++ b/iw/lvm_dialog_gui.py
> @@ -627,7 +627,18 @@ class VolumeGroupEditor:
>              origname = templv.lvname
>              if not templv.exists:
>                  templv._name = lvname
> -                templv.size = size
> +                try:
> +                    templv.size = size
> +                except ValueError:
> +                    self.intf.messageWindow(_("Not enough space"),
> +                                            _("The logical volumes
> you have "
> +                                              "configured require %d
> MB, but the "
> +                                              "volume group only has
> %d MB.  Please "
> +                                              "either make the volume
> group larger "
> +                                              "or make the logical
> volume(s) smaller.")
> +                                              % (size, tempvg.size),
> +                                            custom_icon="error")
> +
>                  format = fmt_class(mountpoint=mountpoint)
>                  if self.lukscb and self.lukscb.get_active() and \
>                     templv.format.type != "luks":
> -- 
> 1.5.4.3
> 
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

_______________________________________________
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