[PATCH] Initialize disks with no partitions (#864360)
Vratislav Podzimek
vpodzime at redhat.com
Mon Oct 15 07:06:36 UTC 2012
On Fri, 2012-10-12 at 17:00 -0700, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
>
> Treat a disk with a disklabel but no partitions the same as an
> uninitialized disk.
> ---
> pyanaconda/storage/__init__.py | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
> index 8df216e..4316e1b 100644
> --- a/pyanaconda/storage/__init__.py
> +++ b/pyanaconda/storage/__init__.py
> @@ -694,6 +694,10 @@ class Storage(object):
> return None
>
> def shouldClear(self, device, **kwargs):
> + def empty_disk():
> + return bool(device.format.type is None or \
> + len(self.devicetree.getChildren(device)) == 0)
I believe bool() is redundant here. And in case you want to leave it
there, you can omit the backslash as the parentheses should do the job.
Apart from that, ACK.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list