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

Ray Strode halfline at gmail.com
Tue Mar 27 19:30:23 UTC 2007


Hi,


> 1) add initial_directory = os.getcwd() at the top of the file and then
> do os.chdir(initial_directory) instead of os.chdir(environ["PWD"])
> 2)  just say the odds of
>    - the current directory getting changed by yum-updatesd after startup
>    - PWD not being set in the environment
>    - yum-updatesd getting invoked directly via a relative path
> all happening are pretty small, and just skip the chdir call if
> environ.has_key("PWD") fails
>
> I don't care which approach we go with.  1) seems easy enough, so I'll
> go for that unless people think 2 is better.
So I went with 1).

> > This also forces people to initialize PluginYumExit with a value instead
> > of just being able to 'raise PluginYumExit'.
> That's true and it's semantic change I didn't mean to introduce.  We
> can add a default empty string to the value argument in the
> constructor.
I did this.

I decided to the leave the translation domain tied to the exception
because it's easier, and I guess you could end up in situations where
the plugin is drawing strings from another source that would have a
different translation domain.  If we always carry the domain next to
the string then we don't have to worry about that sort of thing.
Neither of those reasons are super strong ones, albeit...

Updated patch, attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: yum-3.1.5-propagate-messages.patch
Type: application/octet-stream
Size: 4534 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070327/c192650c/attachment.obj 


More information about the Yum-devel mailing list