[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH] time for instdata to die



> The problem with instdata which moving its content over to anaconda does
> not fix, is that we need access to it almost everywhere. So we keep on
> passing references around. Much the same happens to for example
> storage, be it either in the form of passing around instdata or anaconda
> because we need it, or by passing it around itself.
> 
> All 3 (and others like bootloader) have 2 things in common:
> 1) There is only ever one of them.
> 2) There __init__ methods have no arguments
>    (other the references to the other 2)
> 
> I think it would be much better to untangle this whole mess by making
> anaconda,, booty and storage singletons and there are likely other
> candidates too.

This can certainly be addressed in a followup patch, but for the moment
I'm primarily concerned with getting rid of instdata.  This whole area
is kind of a mess right now (consider that ksdata duplicates a lot of
stuff too, also look at how instdata and install classes are tangled up)
that's going to require further patch series to completely straighten
out.

One thing that I want to be sure of if we go the singleton route is that
we preserve the ability to import major sections of anaconda as python
modules outside running anaconda.  This patch series makes it possible
to import storage from an external program, provided you first create an
Anaconda object.  That's one big reason for making a bunch of things
properties, as well as some of the import cleanups I added.

If we do want to make things singletons, we need to make sure:

(1) Their __init__ methods don't create objects that may not be possible
to have in a normal python script.  This could mean making more things
properties.

(2) We are very careful about where we import files that declare the
singletons.

(3) Removing references to the singletons from method arguments doesn't
make things more complicated.

Hopefully my intentions will be much more clear when I send my patch set
that moves anaconda into /usr/lib/python*.

So I'm not saying no.  I'm saying let's be careful when doing it and
let's wait until after we've removed this big part from the picture.
Maybe more cleanups will start to be more obvious then.

- Chris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]