yum graceful exit from plugin
Dmitry S. Makovey
dmitry at athabascau.ca
Thu Dec 5 03:03:56 UTC 2013
On 12/04/2013 03:02 PM, James Antill wrote:
>>>> Without resorting to
>>>> "sys.exit(0)" is there another way to gracefully stop Yum execution?
>>>
>>> No, not really.
>>
>> too bad :( Any chance of integrating optional exit code into
>> PluginYumExit code and the exception handling routines? ;) I can tinker
>> a bit to provide a patch if you wish.
>
> I'm not dying to do that, but note that raising that exception doesn't
> buy you much over just calling sys.exit() _anyway_.
well it does try to close RPMDB and remove locks the way I read it. But
I think I know what you're after.
> I would highly recommend you do it the other way, have python code you
> own be the top level and create YumBase() instances/etc. ... then call
> whichever functions you want (enabling/disabling other plugins) and exit
> when you want. Look at the latest yum-cron for an ok skeleton.
thanks for the pointer.
> The "main" reason to use a plugin instead of calling the API directly
> is that you get all the yum UI for free, and it's a little bit easier to
> get something going for small enhancements.
> The former doesn't apply to you, and esp. with yum-cron to look at the
> later doesn't really either.
understood
More information about the Yum-devel
mailing list