[Yum-devel] [PATCH] Allow plugins to signal exit status, bump plugin API version to 2.7.

James Antill james at fedoraproject.org
Fri Nov 5 18:30:00 UTC 2010


On Fri, 2010-11-05 at 19:05 +0200, Ville Skyttä wrote:
> On Friday 05 November 2010, James Antill wrote:
> > On Fri, 2010-11-05 at 16:47 +0200, Ville Skyttä wrote:
> > > Useful for example for downloadonly, BZ 531323.
> > > ---
> > > 
> > >  yum/plugins.py |    5 +++--
> > >  yummain.py     |    2 +-
> > >  2 files changed, 4 insertions(+), 3 deletions(-)
> > 
> >  There are two things with this:
> > 
> > 1. We have RFE's for us having a documented list of return codes for yum
> > cli, and what they mean. Letting plugins just do random stuff would make
> > that less useful (assuming we ever did it). Maybe a better idea is to
> > have a map of valid errors, and they pass text:
> >    success  = 0
> >    error    = 1
> >    confused = 3
> >    todo     = 100
> 
> Well, plugins should document their exit statuses anyway; I don't think 
> documenting "if bar happens, it causes foo to exit with status 'confused'" is 
> any clearer to users than "if bar happens, it causes foo to exit with status 
> 93".  How about just defining a range for plugin exit statuses, let's say 200 
> + the_status_they_set, and 0 for signaling success-but-exit-wanted?

 Well I was thinking we could then not have to document everything, just
say "if it's number X it means Y".

 Then again, the plugins can just call sys.exit() ... so just passing
the number is not the end of the world.



More information about the Yum-devel mailing list