On Tue, 2013-12-03 at 15:31 -0700, Dmitry S. Makovey wrote:
> Hi,
> 
> I'm developing a plugin and one annoyance I found is that current way of 
> exiting from yum is via "raise PluginYumExit(...)" which makes yum 
> return exit code 1 - same as when error occurs.

 There is also the "base.exit_code = foo" API, however that is also for
non-zero errors.

>  Without resorting to 
> "sys.exit(0)" is there another way to gracefully stop Yum execution? 

 No, not really.

> When my plugin kicks in - it may decide to forgo "install" phase (and 
> later phases) and stop after download based on certain criteria. However 
> with above issue it's hard to script things, and the only way around I 
> found is to inspect Yum output and send something there by plugin 
> indicating things are OK. But that is far from optimal.

 When we used to have --downloadonly as a plugin, that just called
sys.exit(0) ... and it was problematic enough that we moved it back into
core.
 One thing you could try would be to manipulate the transaction to
remove everything from it, at the correct times.
 But another problem you'll likely have is working out when you should
run your code.

 All of the above, and a few other reasons, is why I'd generally
recommend against making/using plugins ... it's much easier to integrate
features into core and have them all work together well.
 What problems are you trying to solve?

_______________________________________________
Yum-devel mailing list
Yum-devel@lists.baseurl.org
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to