[PATCH 04/11] Don't re-add deleted or hidden devices during DeviceTree.populate.

Vratislav Podzimek vpodzime at redhat.com
Wed Feb 6 08:56:31 UTC 2013


On Tue, 2013-02-05 at 15:13 -0600, David Lehman wrote:
> ---
>  blivet/devicetree.py | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/blivet/devicetree.py b/blivet/devicetree.py
> index a627398..5972b62 100644
> --- a/blivet/devicetree.py
> +++ b/blivet/devicetree.py
> @@ -922,6 +922,21 @@ class DeviceTree(object):
>          uuid = udev_device_get_uuid(info)
>          sysfs_path = udev_device_get_sysfs_path(info)
>  
> +        # make sure this device was not scheduled for removal and also has not
> +        # been hidden
> +        removed = [a.device for a in
> +                    self.findActions(type="destroy", object="device")]
> +        for ignored in removed + self._hidden:
> +            if (sysfs_path and ignored.sysfsPath == sysfs_path) or \
> +               (uuid and uuid in (ignored.uuid, ignored.format.uuid)):
> +                if ignored in removed:
> +                    reason = "removed"
> +                else:
> +                    reason = "hidden"
> +
> +                log.debug("skipping %s device %s" % (reason, name))
> +                return
> +
>          # make sure we note the name of every device we see
>          if name not in self.names:
>              self.names.append(name)
ACK.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list