Re: [PATCH 46/47] Fix PartitionSpec.getActualSize()

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

 



The code looks ok, but i wonder why to use if not drive: ... if drive: ... instead of the plain and simple if drive: .. else: ...

Martin

----- "David Cantrell" <dcantrell@xxxxxxxxxx> wrote:

> Fix autopart run with the new pyparted.
> ---
>  partRequests.py |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/partRequests.py b/partRequests.py
> index e9b86c9..d4b41ce 100644
> --- a/partRequests.py
> +++ b/partRequests.py
> @@ -522,11 +522,11 @@ class PartitionSpec(RequestSpec):
>          for drive in self.drive:
>              part = diskset.disks[drive].getPartitionByPath("/dev/%s"
> % self.device)
>  
> -            if not part:
> -                # XXX kickstart might still call this before
> allocating the partitions
> -                raise RuntimeError, "Checking the size of a partition
> which hasn't been allocated yet"
> +            if part:
> +                size += part.getSize(unit="MB")
>  
> -            size += part.getSize(unit="MB")
> +        if size == 0:
> +            return self.requestSize
>  
>          return size
>  
> -- 
> 1.6.1.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