Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Kernel (http://www.linux-archive.org/debian-kernel/)
-   -   Fix test for unsupported format type in kickstart. (http://www.linux-archive.org/debian-kernel/638295-fix-test-unsupported-format-type-kickstart.html)

David Lehman 02-27-2012 09:37 PM

Fix test for unsupported format type in kickstart.
 
---
pyanaconda/kickstart.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index aede8da..23c624a 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -559,7 +559,7 @@ class LogVolData(commands.logvol.F15_LogVolData):
label=self.label,
fsprofile=self.fsprofile,
mountopts=self.fsopts)
- if not format:
+ if not format.type:
raise KickstartValueError, formatErrorMsg(self.lineno, msg="The "%s" filesystem type is not supported." % type)

# If we were given a pre-existing LV to create a filesystem on, we need
@@ -878,7 +878,7 @@ class PartitionData(commands.partition.F12_PartData):
label=self.label,
fsprofile=self.fsprofile,
mountopts=self.fsopts)
- if not kwargs["format"]:
+ if not kwargs["format"].type:
raise KickstartValueError, formatErrorMsg(self.lineno, msg="The "%s" filesystem type is not supported." % type)

# If we were given a specific disk to create the partition on, verify
@@ -1051,7 +1051,7 @@ class RaidData(commands.raid.F15_RaidData):
fsprofile=self.fsprofile,
mountpoint=self.mountpoint,
mountopts=self.fsopts)
- if not kwargs["format"]:
+ if not kwargs["format"].type:
raise KickstartValueError, formatErrorMsg(self.lineno, msg="The "%s" filesystem type is not supported." % type)

kwargs["name"] = devicename
--
1.7.7.6

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

"Brian C. Lane" 02-27-2012 11:56 PM

Fix test for unsupported format type in kickstart.
 
On Mon, Feb 27, 2012 at 04:37:16PM -0600, David Lehman wrote:
> ---
> pyanaconda/kickstart.py | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> index aede8da..23c624a 100644
> --- a/pyanaconda/kickstart.py
> +++ b/pyanaconda/kickstart.py
> @@ -559,7 +559,7 @@ class LogVolData(commands.logvol.F15_LogVolData):
> label=self.label,
> fsprofile=self.fsprofile,
> mountopts=self.fsopts)
> - if not format:
> + if not format.type:
> raise KickstartValueError, formatErrorMsg(self.lineno, msg="The "%s" filesystem type is not supported." % type)
>
> # If we were given a pre-existing LV to create a filesystem on, we need
> @@ -878,7 +878,7 @@ class PartitionData(commands.partition.F12_PartData):
> label=self.label,
> fsprofile=self.fsprofile,
> mountopts=self.fsopts)
> - if not kwargs["format"]:
> + if not kwargs["format"].type:
> raise KickstartValueError, formatErrorMsg(self.lineno, msg="The "%s" filesystem type is not supported." % type)
>
> # If we were given a specific disk to create the partition on, verify
> @@ -1051,7 +1051,7 @@ class RaidData(commands.raid.F15_RaidData):
> fsprofile=self.fsprofile,
> mountpoint=self.mountpoint,
> mountopts=self.fsopts)
> - if not kwargs["format"]:
> + if not kwargs["format"].type:
> raise KickstartValueError, formatErrorMsg(self.lineno, msg="The "%s" filesystem type is not supported." % type)
>
> kwargs["name"] = devicename
> --
> 1.7.7.6

I think all of these should test if not format or not format.type since
getFormat() can return None.

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

David Lehman 02-28-2012 12:48 AM

Fix test for unsupported format type in kickstart.
 
On Mon, 2012-02-27 at 16:56 -0800, Brian C. Lane wrote:
> On Mon, Feb 27, 2012 at 04:37:16PM -0600, David Lehman wrote:
> > ---
> > pyanaconda/kickstart.py | 6 +++---
> > 1 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> > index aede8da..23c624a 100644
> > --- a/pyanaconda/kickstart.py
> > +++ b/pyanaconda/kickstart.py
> > @@ -559,7 +559,7 @@ class LogVolData(commands.logvol.F15_LogVolData):
> > label=self.label,
> > fsprofile=self.fsprofile,
> > mountopts=self.fsopts)
> > - if not format:
> > + if not format.type:
> > raise KickstartValueError, formatErrorMsg(self.lineno, msg="The "%s" filesystem type is not supported." % type)
> >
> > # If we were given a pre-existing LV to create a filesystem on, we need
> > @@ -878,7 +878,7 @@ class PartitionData(commands.partition.F12_PartData):
> > label=self.label,
> > fsprofile=self.fsprofile,
> > mountopts=self.fsopts)
> > - if not kwargs["format"]:
> > + if not kwargs["format"].type:
> > raise KickstartValueError, formatErrorMsg(self.lineno, msg="The "%s" filesystem type is not supported." % type)
> >
> > # If we were given a specific disk to create the partition on, verify
> > @@ -1051,7 +1051,7 @@ class RaidData(commands.raid.F15_RaidData):
> > fsprofile=self.fsprofile,
> > mountpoint=self.mountpoint,
> > mountopts=self.fsopts)
> > - if not kwargs["format"]:
> > + if not kwargs["format"].type:
> > raise KickstartValueError, formatErrorMsg(self.lineno, msg="The "%s" filesystem type is not supported." % type)
> >
> > kwargs["name"] = devicename
> > --
> > 1.7.7.6
>
> I think all of these should test if not format or not format.type since
> getFormat() can return None.

It actually cannot return None. That comment is wrong. If you look at
get_device_format_class, it will return DeviceFormat if it couldn't do
any better.

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


_______________________________________________
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 12:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.