[Yum-devel] [PATCH] Allow plugins to signal exit status, bump plugin API version to 2.7.
Ville Skyttä
ville.skytta at iki.fi
Fri Nov 5 17:05:02 UTC 2010
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?
> 2. Might as well add something to stop the message too.
In case of downloadonly, in my opinion the "exiting because --downloadonly
specified" message is good to have. downloadonly probably could do this via
logging though. Is this the message you referred to?
More information about the Yum-devel
mailing list