More robust filtering of physical volumes in autopartioning (#475271)
Corner case of logical volume with fstype detected as "physical volume
(LVM)" caused traceback. Modified Chris Lumens' patch applied.
---
autopart.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/autopart.py b/autopart.py
index 4c752a8..c07cafc 100644
--- a/autopart.py
+++ b/autopart.py
@@ -1411,13 +1411,14 @@ def doAutoPartition(anaconda):
len(partitions.autoClearPartDrives) == 0):
valid = 1
else:
- if not isinstance(r, partRequests.RaidRequestSpec):
+ if (isinstance(r, partRequests.PartitionSpec) and
+ r.drive):
for d in r.drive:
if d in partitions.autoClearPartDrives:
valid = 1
break
- if not isinstance(r, partRequests.RaidRequestSpec):
+ if isinstance(r, partRequests.PartitionSpec):
if not r.multidrive:
valid = 0
--
1.5.4.3
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
02-24-2009, 02:06 PM
Chris Lumens
More robust filtering of physical volumes in autopartioning (#475271)
> len(partitions.autoClearPartDrives) == 0):
> valid = 1
> else:
> - if not isinstance(r, partRequests.RaidRequestSpec):
> + if (isinstance(r, partRequests.PartitionSpec) and
> + r.drive):
I can't ever remember how python works with putting conditionals across
two lines. You may have to make those into one.
Looks fine, though. It took me a minute to remember I'd even made a
patch for this. Thanks for fixing the additional case there.
- Chris
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
02-24-2009, 02:39 PM
Radek Vykydal
More robust filtering of physical volumes in autopartioning (#475271)
Chris Lumens wrote:
len(partitions.autoClearPartDrives) == 0):
valid = 1
else:
- if not isinstance(r, partRequests.RaidRequestSpec):
+ if (isinstance(r, partRequests.PartitionSpec) and
+ r.drive):
I can't ever remember how python works with putting conditionals across
two lines. You may have to make those into one.
I thought it was just parenthesis continuation, not aware of any quirks
of it.
I have no problem with joing the line, now when I look at it, it would
be more
readable with the and operator on the second line anyway.
Thanks for review
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
02-24-2009, 02:51 PM
Jeffrey Bastian
More robust filtering of physical volumes in autopartioning (#475271)
Radek Vykydal wrote:
Chris Lumens wrote:
I can't ever remember how python works with putting conditionals across
two lines. You may have to make those into one.
I thought it was just parenthesis continuation, not aware of any quirks
of it.
I have a hard time with this too. Statements inside parentheses can be
split across lines, or you can use a backslash at the end of a line (but
of course this can introduce problems if there's whitespace after the
backslash).