FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Desktop

 
 
LinkBack Thread Tools
 
Old 02-24-2009, 09:10 AM
Radek Vykydal
 
Default 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
 
Old 02-24-2009, 02:06 PM
Chris Lumens
 
Default 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
 
Old 02-24-2009, 02:39 PM
Radek Vykydal
 
Default 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
 
Old 02-24-2009, 02:51 PM
Jeffrey Bastian
 
Default 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).


http://docs.python.org/dev/howto/doanddont.html#using-backslash-to-continue-statements

Jeff

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 11:26 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org