[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: [PATCH 03/11] Device class does not have a format member
- From: David Lehman <dlehman redhat com>
- To: Discussion of Development and Customization of the Red Hat Linux Installer <anaconda-devel-list redhat com>
- Subject: Re: [PATCH 03/11] Device class does not have a format member
- Date: Tue, 01 Sep 2009 10:40:11 -0500
On Tue, 2009-09-01 at 15:04 +0200, Hans de Goede wrote:
> The packages property in the Device class references format.packages, but
> format is not a member of Device (only of StorageDevice and derived classes),
> and format may be None.
>
> This error was caught by pylint and chances are we will never hit it, still
> it is better to fix it.
This would be better fixed by moving the format-related bits into
StorageDevice.packages.
Dave
> ---
> storage/devices.py | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/storage/devices.py b/storage/devices.py
> index 2be684f..37ec420 100644
> --- a/storage/devices.py
> +++ b/storage/devices.py
> @@ -357,15 +357,17 @@ class Device(object):
> devices.
> """
> packages = self._packages
> - packages.extend(self.format.packages)
> + if getattr(self, "format", None):
> + packages.extend(self.format.packages)
> for parent in self.parents:
> for package in parent.packages:
> if package not in packages:
> packages.append(package)
>
> - for package in parent.format.packages:
> - if package not in packages:
> - packages.append(package)
> + if getattr(parent, "format", None):
> + for package in parent.format.packages:
> + if package not in packages:
> + packages.append(package)
>
> return packages
>
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]