Re: [PATCH 01/13] Let users set the size property of StorageDevices.

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

 



On Fri, 2009-03-13 at 18:09 -1000, David Cantrell wrote:
> For resize operations, we need the ability to set a new size for
> the StorageDevice before performing the resize.

Aside from calling maxSize as a method instead of a property, this looks
good.

> 
> Raise DeviceError exception if newsize > maxSize
> ---
>  storage/devices.py |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/storage/devices.py b/storage/devices.py
> index 39ffcf7..de18113 100644
> --- a/storage/devices.py
> +++ b/storage/devices.py
> @@ -587,11 +587,13 @@ class StorageDevice(Device):
>  
>      def _setSize(self, newsize):
>          """ Set the device's size to a new value. """
> -        # FIXME: this should involve some verification
> +        if newsize > self.maxSize():
> +            raise DeviceError("device cannot be larger than %s MB" %
> +                              (self.maxSize(),))

self.maxSize is a property.

>          self._size = newsize
>  
>      size = property(lambda x: x._getSize(),
> -                    #lambda x, y: x._setSize(y),
> +                    lambda x, y: x._setSize(y),
>                      doc="The device's size, accounting for pending changes")
>  
>      @property

_______________________________________________
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