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 |
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 |
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 |
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 |
| All times are GMT. The time now is 09:18 PM. |
VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.