[PATCH 2/2] Do not schedule resize actions for non-resizing requests (#1039491)
David Lehman
dlehman at redhat.com
Wed Dec 11 15:45:07 UTC 2013
On Wed, 2013-12-11 at 08:19 -0500, Anne Mulhern wrote:
>
>
>
> ----- Original Message -----
> > From: "Vratislav Podzimek" <vpodzime at redhat.com>
> > To: anaconda-patches at lists.fedorahosted.org
> > Sent: Wednesday, December 11, 2013 6:09:23 AM
> > Subject: [PATCH 2/2] Do not schedule resize actions for non-resizing requests (#1039491)
> >
> > If user requests a partition to be shrinked, but then leaves the original
> > size
> > as the target size, we should simply ignore such "shrink request".
> >
> > Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
> > ---
> > pyanaconda/ui/gui/spokes/lib/resize.py | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py
> > b/pyanaconda/ui/gui/spokes/lib/resize.py
> > index ee5cdbe..f1a1bb2 100644
> > --- a/pyanaconda/ui/gui/spokes/lib/resize.py
> > +++ b/pyanaconda/ui/gui/spokes/lib/resize.py
> > @@ -387,7 +387,7 @@ class ResizeDialog(GUIObject):
> >
> > if obj.action == _(PRESERVE):
> > return False
> > - elif obj.action == _(SHRINK):
> > + elif obj.action == _(SHRINK) and int(device.size) !=
> > int(obj.target):
> > if device.resizable:
> > self.storage.resizeDevice(device, obj.target)
> > else:
> > --
> > 1.8.4.2
>
> I guess that for the GUI it makes sense just to ignore a request to resize to same size.
>
> In blivet.deviceaction.ActionResize, though...
>
> wouldn't it make sense to move the check for currentSize == newSize from __init__
> to execute and make it a check instead of an exception?
>
> Make execute something like:
>
> def execute(self):
> if device.currentSize != self.device.targetSize:
> self.device.resize()
>
> taking into account the types of both, of course.
>
> If the user schedules a resize to the same size, there shouldn't be any problem with it completing succesfully, so it's not worth an exception, IMHO.
I could live with that if the check were in the device or format resize
method instead of in the action execute method.
>
> - mulhern
>
>
>
>
> >
> > _______________________________________________
> > anaconda-patches mailing list
> > anaconda-patches at lists.fedorahosted.org
> > https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> >
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
More information about the anaconda-patches
mailing list