[Yum-devel] request: yumvar plugin hook

Michael E Brown Michael_E_Brown at dell.com
Tue Apr 17 14:26:39 UTC 2007


On Mon, Apr 16, 2007 at 11:21:24PM -0400, seth vidal wrote:
> On Mon, 2007-04-16 at 23:04 -0400, seth vidal wrote:
> > okay, I'm looking at this code and other spots and two things pop into
> > mind:
> > 
> > 1. it seems like it might make more sense to have a pre_config_hook and
> > a post_config_hook so people could molest the config obj before and
> > after its setup - that would cover yumvars.
> > 
> > 2. odd that we're not using the config slot anywhere at all, even though
> > it appears to be defined in plugins.py. it might be best to make these
> > lines in __init__.py:
> > 
> >         self.conf = config.readMainConfig(startupconf)
> >         self.yumvar = self.conf.yumvar
> >         self.getReposFromConfig()
> > 
> > into:
> > 
> >         self.conf = config.readMainConfig(startupconf)
> >         self.plugins.run('config')
> >         self.yumvar = self.conf.yumvar
> >         self.getReposFromConfig()

the problem here is that the 'config' plugin is already called from
plugins.py. This would mean that the config plugin is called twice, and,
most probably, lots of config plugins are going to be unhappy about
that.

For my uses, simply moving the init plugin up a few lines works fine.
Not sure that many plugins need the repo configs simply because they
would probably run into the same issues I did.

Jeremy, James, I was talking to Seth last night on irc and he said to
ping you guys about this since he is sort of offline.
--
Michael



More information about the Yum-devel mailing list