[blivet][master/rhel7-branch][PATCH] Allow user code provide callbacks for various actions/events

Vratislav Podzimek vpodzime at redhat.com
Fri Aug 29 07:36:19 UTC 2014


On Thu, 2014-08-28 at 16:23 -0700, Brian C. Lane wrote:
> On Thu, Aug 28, 2014 at 10:09:35AM -0400, Anne Mulhern wrote:
> > Getting rid of another of blivet's dependencies on anaconda is good, but..
> > 
> > The device here of the callbacks simply replacing the progress
> > report context manager seems questionable. It seems
> > like what is needed here is some kind of message queue which
> > clients can listen to if they want to.
> > 
> > That blivet should have a callback mechanism seems quite correct.
> > But I'm dubious about the idea of passing the _CallbacksRegister
> > object around among a lot of different methods instead of actually
> > registering the callback somehow on an appropriate object.
> 
> Unless there are going to be different callbacks per-method, I agree, it
> should be registered someplace like the Blivet class instead of passing
> it around everywhere.
See my reply to mulhern's comments for a more comprehensive reasoning,
but a quick question here is: What do you mean by "passing it around
everywhere?" We create some partitioning scheme (aka storage
configuration) and when calling the .doIt method we pass callbacks for
actions happening in that process. The callbacks then go through two
methods doIt->processActions to the actions themselves. Maybe the patch
looks worse than it actually is, but I don't think that's a terribly
complicated scheme of passing something weird somewhere far and deep.

-- 
Vratislav Podzimek

Anaconda Rider | RHCE | Red Hat, Inc. | Brno - Czech Republic




More information about the anaconda-patches mailing list