[Yum-devel] patch to propagate initialization errors to the emitters in the updates-daemon
Luke Macken
lmacken at redhat.com
Fri Mar 23 09:23:24 UTC 2007
Following up with our chat on IRC...
On Wed, Feb 28, 2007 at 04:41:32PM -0500, Ray Strode wrote:
> Hi,
>
> 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.
I'm ignorant in the ways of translation domains, so I'm not sure if
stuffing this in the PluginYumExit exception is the best place or not.
I also have no knowledge as to what your yum plugin actually does, but I
assume throwing the puplet an error code instead of a message +
translation domain won't suffice ?
> 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.
>
> 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.
>
> Thoughts?
This patch should speed up the startup time of the update daemon, as
YumBase.doConfigSetup is only called when updatesCheck is executed
(either when called by puplet directly, or after the timeout interval),
instead of when the daemon is initialized.
os.environ['PWD'] doesn't seem to exist when I run the update daemon via
`sudo ./yum-updatesd.py -f`, which causes restart() to explode. Maybe
os.getcwd() instead ?
This also forces people to initialize PluginYumExit with a value instead
of just being able to 'raise PluginYumExit'.
As I mentioned, my translation domain knowledge is non-existent, so
whether or not this is a good place to stuff this is beyond me.
What does everyone else think ?
luke
More information about the Yum-devel
mailing list