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 Kernel Team

 
 
LinkBack Thread Tools
 
Old 03-25-2009, 12:12 PM
Joel Granados Moreno
 
Default Device is sometimes None.

If its none there is no need to parse it.
---
storage/formats/fs.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/storage/formats/fs.py b/storage/formats/fs.py
index 9350651..9480c53 100644
--- a/storage/formats/fs.py
+++ b/storage/formats/fs.py
@@ -1012,7 +1012,9 @@ class NFS(FS):
_type = "nfs"

def _deviceCheck(self, devspec):
- if not ":" in devspec:
+ if devspec == None:
+ pass
+ elif not ":" in devspec:
raise ValueError("device must be of the form <host>:<path>")

@property
--
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-25-2009, 12:20 PM
Ignacio Vazquez-Abrams
 
Default Device is sometimes None.

On Wed, 2009-03-25 at 14:12 +0100, Joel Granados Moreno wrote:
> + if devspec == None:

Use is when comparing against None.

--
Ignacio Vazquez-Abrams <ivazqueznet@gmail.com>

PLEASE don't CC me; I'm already subscribed
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-25-2009, 12:21 PM
Radek Vykydal
 
Default Device is sometimes None.

Joel Granados Moreno wrote:

If its none there is no need to parse it.
---
storage/formats/fs.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/storage/formats/fs.py b/storage/formats/fs.py
index 9350651..9480c53 100644
--- a/storage/formats/fs.py
+++ b/storage/formats/fs.py
@@ -1012,7 +1012,9 @@ class NFS(FS):
_type = "nfs"

def _deviceCheck(self, devspec):

- if not ":" in devspec:
+ if devspec == None:
+ pass
+ elif not ":" in devspec:
raise ValueError("device must be of the form <host>:<path>")

@property


I'd patch with
+ if devspec is not None and ":" not in devspec:
but it's only more readable to me,
I'm ok with the patch

Radek

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-25-2009, 12:42 PM
Joel Granados
 
Default Device is sometimes None.

On Wed, Mar 25, 2009 at 02:21:11PM +0100, Radek Vykydal wrote:
> Joel Granados Moreno wrote:
>> If its none there is no need to parse it.
>> ---
>> storage/formats/fs.py | 4 +++-
>> 1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/storage/formats/fs.py b/storage/formats/fs.py
>> index 9350651..9480c53 100644
>> --- a/storage/formats/fs.py
>> +++ b/storage/formats/fs.py
>> @@ -1012,7 +1012,9 @@ class NFS(FS):
>> _type = "nfs"
>> def _deviceCheck(self, devspec):
>> - if not ":" in devspec:
>> + if devspec == None:
>> + pass
>> + elif not ":" in devspec:
>> raise ValueError("device must be of the form <host>:<path>")
>> @property
>>

Ok, I'll implement it that way. Its a temp thing, hopefully

> I'd patch with
> + if devspec is not None and ":" not in devspec:
> but it's only more readable to me,
> I'm ok with the patch
>
> Radek
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

--
Joel Andres Granados
Brno, Czech Republic, Red Hat.

_______________________________________________
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 07:52 AM.

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