[PATCH 2/3] Don't raise an exception for failure to scan an ignored disk.

Anne Mulhern amulhern at redhat.com
Tue Jan 20 19:59:15 UTC 2015





----- Original Message -----
> From: "David Lehman" <dlehman at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Tuesday, January 20, 2015 2:53:59 PM
> Subject: [PATCH 2/3] Don't raise an exception for failure to scan an ignored	disk.
> 
> The disk will be ignored anyway, so it should not matter if there are
> active devices on it since we won't be trying to write to it.
> 
> Related: rhbz#1123450
> ---
>  blivet/devicetree.py | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/blivet/devicetree.py b/blivet/devicetree.py
> index 41cc42e..ea82645 100644
> --- a/blivet/devicetree.py
> +++ b/blivet/devicetree.py
> @@ -943,8 +943,10 @@ class DeviceTree(object):
>              #  - devices that do not have a usable disklabel
>              #  - devices that contain disklabels made by isohybrid
>              #
> -            if (disk.partitionable and not
> -                (disk.format.type == "iso9660" or disk.format.hidden)):
> +            if disk.partitionable and \
> +               disk.format.type != "iso9660" and \
> +               not disk.format.hidden and \
> +               not self._isIgnoredDisk(disk):
>                  raise DeviceTreeError("failed to scan disk %s" % disk.name)
>  
>              # there's no need to filter partitions on members of multipaths
>              or
> @@ -2176,15 +2178,15 @@ class DeviceTree(object):
>          if flags.installer_mode:
>              self.teardownAll()
>  
> -    def _hideIgnoredDisks(self):
> -        def _is_ignored(disk):
> -            return ((self.ignoredDisks and disk.name in self.ignoredDisks)
> or
> -                    (self.exclusiveDisks and
> -                     disk.name not in self.exclusiveDisks))
> +    def _isIgnoredDisk(self, disk):
> +        return ((self.ignoredDisks and disk.name in self.ignoredDisks) or
> +                (self.exclusiveDisks and
> +                 disk.name not in self.exclusiveDisks))
>  
> +    def _hideIgnoredDisks(self):
>          # hide any subtrees that begin with an ignored disk
>          for disk in [d for d in self._devices if d.isDisk]:
> -            if _is_ignored(disk):
> +            if self._isIgnoredDisk(disk):
>                  ignored = True
>                  # If the filter allows all members of a fwraid or mpath, the
>                  # fwraid or mpath itself is implicitly allowed as well. I
>                  don't
> --
> 1.9.3
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

Ack.

- mulhern


More information about the anaconda-patches mailing list