On Tue, 2014-02-25 at 07:34 -0500, Anne Mulhern wrote:
----- Original Message -----
> From: "David Lehman" <dlehman(a)redhat.com>
> To: anaconda-patches(a)lists.fedorahosted.org
> Sent: Monday, February 24, 2014 4:42:22 PM
> Subject: [PATCH] Update disk refs when recovering from a devicefactory failure.
(#1032141)
>
> ---
> pyanaconda/ui/gui/spokes/custom.py | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/pyanaconda/ui/gui/spokes/custom.py
> b/pyanaconda/ui/gui/spokes/custom.py
> index 2f2422a..6ca4a20 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -1448,6 +1448,12 @@ class CustomPartitioningSpoke(NormalSpoke,
> StorageChecker):
> if _device is None:
> # in this case we have removed the old device so we
> now have
> # to re-create it
> +
> + # the disks need to be updated since we've replaced
> all
> + # of the devices with copies in the devicefactory
> error
> + # handler
> + old_disk_names = [d.name for d in old_disks]
> + old_disks =
> [self.__storage.devicetree.getDeviceByName(n) for n in old_disk_names]
> try:
> self._replace_device(old_device_type,
> device.size,
> disks=old_disks,
> --
> 1.8.5.3
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches(a)lists.fedorahosted.org
>
https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
I recently fixed a bug (#981316) where getDeviceByID() was returning None for disks which
were no longer there.
Is it guaranteed that getDeviceByName() will always find a disk?
It should be, yes. There is no way to change the disk set within the
custom spoke, let alone within a call to Blivet.factoryDevice. Non-disk
block devices come and go, but disk set should always remain constant
within any given visit to the custom spoke.
David
- mulhern
_______________________________________________
anaconda-patches mailing list
anaconda-patches(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches