[blivet 0/2] Make get_device_format_class behave as expected
Vratislav Podzimek
vpodzime at redhat.com
Mon Dec 2 13:57:43 UTC 2013
On Mon, 2013-12-02 at 08:53 -0500, Anne Mulhern wrote:
>
>
>
> ----- Original Message -----
> > From: "Vratislav Podzimek" <vpodzime at redhat.com>
> > To: "anaconda patch review" <anaconda-patches at lists.fedorahosted.org>
> > Sent: Thursday, November 28, 2013 3:54:44 AM
> > Subject: Re: [blivet 0/2] Make get_device_format_class behave as expected
> >
> > On Wed, 2013-11-27 at 16:39 -0500, mulhern wrote:
> > > Basically, most clients of get_device_format_class expect it to return None
> > > if it can not successfully do a class lookup. However, it has been
> > > returning DeviceFormat instead.
> > I'd like to know dlehman's opinion here, but from the discussions about
> > the the unknown format resizing I found out that returning DeviceFormat
> > class is the expected behaviour for formats we don't recognize/support.
> >
> > --
> > Vratislav Podzimek
>
> It's a bit more subtle. There's this significant difference between the
> expected behavior of get_device_format_class and getFormat. getFormat
> returns an instance of the DeviceFormat class when it can not find
> anything better, and its clients expect that behavior.
> get_device_format_class has been returning the DeviceFormat class
> object when it can not find a class, and its clients clearly don't
> expect this behavior. Also, get_device_format_class is really just a
> lookup among loaded classes and packages, and it is important to have
> some way of finding out whether it couldn't find the class for the
> given name.
That makes sense. Thanks for the explanation!
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list