[Yum-devel] patch to propagate initialization errors to the emitters in the updates-daemon

Jeremy Katz katzj at redhat.com
Thu Mar 1 17:12:22 UTC 2007


On Wed, 2007-02-28 at 16:41 -0500, Ray Strode wrote:
> I'm working on a project that has a yum plugin that does some things
> that can conceivably fail as part of its init_hook .  I'd like for the
> plugin to be able to propagate error messages from init_hook failures
> up to pup, so that pup can display the error messages to the user.
> 
> One complication is that the user may be using a locale that is
> different than the locale that yum-updatesd is running with.  This
> means that we need to pass the translation domain "e.g.,
> 'yum-updatesd' or 'messages' or 'mypluginname'" along with the error
> message so that pup can look up the appropriate translation for the
> language the user is logged in as.

Seems mostly reasonable, although a tad kludgy.  But like I said when we
were talking on IRC, I don't know how to avoid that.

> Another complication is that the user may not be logged in when the
> error happens.  I'm not sure of a good solution to this problem (short
> of queuing the messages which could get pretty complicated), so it's
> one I'm sort of punting on.  Note the user will probably eventually
> see the message because yum-updatesd will try the same operation again
> after the update interval times out and fail again.  Also, if pup
> calls the CheckNow() api on startup then the user will get the message
> when they first login, so I don't think its a huge deal.

I think that this is okay.  puplet _does_ call the refresh and if your
error was "run some application", that application could also ask for
the refresh.

> It might be interesting to pass the translation domain as part of the
> other signals that yum-updatesd emits, but that will break API.  I
> don't know that's okay.

I think without a real need for it, I'd lean against breaking the API.
Especially as we could add another signal with the translated bits if we
really want and then apps could watch for whichever they want.

The only part that I'm a little less sure if anyone has a better way is
the translation domain bits for the plugin.  That feels kind of ugly and
more like something that's related to the plugin instead of the
exception.  Then again, I wasn't aware of PluginYumExit until recently
anyway, so maybe I'm the wrong person to comment there :-)

Jeremy




More information about the Yum-devel mailing list