[PATCH] Update parted partitions on hidden disks when copying a Blivet. (#1023556)

Brian C. Lane bcl at redhat.com
Tue Oct 29 20:36:30 UTC 2013


On Fri, Oct 25, 2013 at 05:14:29PM -0500, David Lehman wrote:
> ---
>  blivet/__init__.py | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/blivet/__init__.py b/blivet/__init__.py
> index 0aa4897..731482b 100644
> --- a/blivet/__init__.py
> +++ b/blivet/__init__.py
> @@ -1925,11 +1925,13 @@ class Blivet(object):
>          new = copy.deepcopy(self)
>          # go through and re-get partedPartitions from the disks since they
>          # don't get deep-copied
> -        for partition in new.partitions:
> +        hidden_partitions = [d for d in new.devicetree._hidden
> +                                if isinstance(d, PartitionDevice)]
> +        for partition in new.partitions + hidden_partitions:
>              if not partition._partedPartition:
>                  continue
>  
> -            # don't ask me why, but we have to update the refs in req_disks
> +            # update the refs in req_disks as well
>              req_disks = []
>              for disk in partition.req_disks:
>                  req_disks.append(new.devicetree.getDeviceByID(disk.id))
> -- 
> 1.8.1.4
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches

Ack

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list