[Yum-devel] Default plugin init, option parsers, and ligers
Panu Matilainen
pmatilai at laiskiainen.org
Tue Sep 5 20:32:22 UTC 2006
On Tue, 2006-08-22 at 09:17 +0100, Menno Smits wrote:
> seth vidal wrote:
> > On Mon, 2006-08-21 at 12:23 -0400, Jeremy Katz wrote:
> >> So, Luke hit something where if you do python -c 'import yum; my =
> >> yum.YumBase(); my.doConfigSetup()' with a plugin like downloadonly
> >> installed, you get a traceback as there isn't an option parser
> >> available for the plugin to hook into. The same was actually true
> >> with 2.6.x, except that you had to explicitly initialize plugins.
> >>
> >> Does it make sense to either a) Switch back to where plugins are
> >> only initialized if you pass init_plugins=True to doConfigSetup
> > I'd be inclined to this one.
> >
> > Something intentional makes sense.
>
> I would argue that TYPE_CORE plugins _should_ be loaded by default to
> help ensure consistent behaviour across clients of the Yum code. For
> example, if yum itself is running with the protectbase plugin enabled
> and a Yum client like Pup (or whatever) wasn't, there would be
> inconsistent sets of packages seen by both systems. By setting good
> defaults we avoid problems like this.
>
> I propose:
> - leaving in init_plugins=True
> - setting plugin_types=(plugins.TYPE_CORE,)
Except that now plugins of type != TYPE_CORE never get loaded AFAICT.
Shouldn't it be
- TYPE_CORE plugins are always loaded unless plugins are disabled
- yum-cli loads both TYPE_CORE and TYPE_INTERACTIVE plugins unless
plugins are disabled
Basically:
--- cli.py 4 Sep 2006 16:33:30 -0000 1.233
+++ cli.py 5 Sep 2006 20:25:20 -0000
@@ -37,6 +37,7 @@
from yum.packages import parsePackages, YumInstalledPackage, YumLocalPackage
from yum import pgpmsg
from yum import logginglevels
+from yum import plugins
from i18n import _
import callback
import urlgrabber
@@ -186,6 +187,7 @@
self.doConfigSetup(opts.conffile, root,
init_plugins=not opts.noplugins,
optparser=self.optparser,
+ plugin_types=(plugins.TYPE_CORE,plugins.TYPE_INTERFACE,),
debuglevel=opts.debuglevel,
errorlevel=opts.errorlevel)
except yum.Errors.ConfigError, e:
More information about the Yum-devel
mailing list