[blivet] Never pass None to devicePathToName (#996303)

Vratislav Podzimek vpodzime at redhat.com
Wed Mar 12 06:54:46 UTC 2014


On Tue, 2014-03-11 at 16:53 -0400, David Shea wrote:
> Provide a string default to getattr so that logging doesn't crash if
> there an error looking up partitions.
Missing ^"is"

> ---
>  blivet/devices.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/blivet/devices.py b/blivet/devices.py
> index fb24b10..c2d1869 100644
> --- a/blivet/devices.py
> +++ b/blivet/devices.py
> @@ -1341,14 +1341,14 @@ class PartitionDevice(StorageDevice):
>              # getPartitionBySector doesn't work on extended partitions
>              _partition = _disklabel.extendedPartition
>              log.debug("extended lookup found partition %s"
> -                        % devicePathToName(getattr(_partition, "path", None)))
> +                        % devicePathToName(getattr(_partition, "path", "(none)")))
>          else:
>              # lookup the partition by sector to avoid the renumbering
>              # nonsense entirely
>              _sector = self.partedPartition.geometry.start
>              _partition = _disklabel.partedDisk.getPartitionBySector(_sector)
>              log.debug("sector-based lookup found partition %s"
> -                        % devicePathToName(getattr(_partition, "path", None)))
> +                        % devicePathToName(getattr(_partition, "path", "(none)")))
>  
>          self.partedPartition = _partition
ACK. 

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list