[Yum-devel] protect-packages plugin - compatibility with yum 2.4
Michael E Brown
Michael_E_Brown at dell.com
Mon Jul 9 19:46:46 UTC 2007
On Mon, Jul 09, 2007 at 10:35:53AM -0700, Greg Swallow wrote:
> Tim Lauridsen wrote:
> > This should do the tricks.
> > from yum.plugins import TYPE_INTERACTIVE, TYPE_CORE, API_VERSION,
> TYPE_INTERFACE
> > plugin_type = (API_VERSION <= 2.3 and TYPE_INTERFACE or TYPE_INTERACTIVE,
> > TYPE_CORE)
>
> No luck...When using yum 2.4 (yum-2.4.3-4.el4.centos) I still get the error:
>
> "ImportError: cannot import name TYPE_INTERACTIVE"
You can trivially wrap each import in a try: ... except ImportError:...
Import the new names, and on import error, fall back to the old names.
--
Michael
More information about the Yum-devel
mailing list