Here is my modified XenAPIPlugin.py. Now it catches exceptions in the plugin method, and returns their class and error message to the caller in the XMLRPC ErrorDescription field. I've also refactored the control flow a little bit, even though this ought to be a separate optional change...
Here is my modified XenAPIPlugin.py. Now it catches exceptions in the plugin method, and returns their class and error message to the caller in the XMLRPC ErrorDescription field.
I've also refactored the control flow a little bit, even though this ought to be a separate optional change...

Behaviour:
returns XENAPI_PLUGIN_FAILURE if the plugin fails syntax error, non-zero exit code),
returns XENAPI_PLUGIN_EXCEPTION if running it raises and exception other than SystemExit,
returns UNKNOWN_XENAPI_PLUGIN_FUNCTION if the method is not registred, and
the result string otherwise.

Acked-by: Dave Scott <63c9eb0ea83039690fefa11afe17873ba8278a56@citrix.com>

koushikcgit/xen-api,euanh/xen-api,thomassa/xen-api,euanh/xen-api,robertbreker/xen-api,rafalmiel/xen-api,guard163/xen-api,simonjbeaumont/xen-api,simonjbeaumont/xen-api,cheng-z/xen-api,euanh/xen-api,Frezzle/xen-api,anoobs/xen-api,agimofcarmen/xen-api,thomassa/xen-api,anoobs/xen-api,simonjbeaumont/xcp-rrdd,robertbreker/xen-api,guard163/xen-api,anoobs/xen-api,robhoes/squeezed,johnelse/xcp-rrdd,guard163/xen-api,djs55/xen-api,ravippandey/xen-api,cheng-z/xen-api,cheng--zhang/xen-api,rafalmiel/xen-api,djs55/xen-api,cheng--zhang/xen-api,djs55/xen-api,sharady/xcp-networkd,huizh/xen-api,srowe/xen-api,robertbreker/xen-api,simonjbeaumont/xcp-rrdd,Frezzle/xen-api,salvocambria/xen-api,simonjbeaumont/xen-api,guard163/xen-api,vasilenkomike/xen-api,srowe/xen-api,ravippandey/xen-api,jjd27/xen-api,rafalmiel/xen-api,salvocambria/xen-api,srowe/xen-api,simonjbeaumont/xen-api,simonjbeaumont/xen-api,djs55/squeezed,cheng-z/xen-api,djs55/xcp-networkd,euanh/xen-api,koushikcgit/xen-api,djs55/xen-api,agimofcarmen/xen-api,huizh/xen-api,Frezzle/xen-api,djs55/xen-api,jjd27/xen-api,agimofcarmen/xen-api,agimofcarmen/xen-api,thomassa/xen-api,srowe/xen-api,cheng-z/xen-api,djs55/xen-api,djs55/xcp-networkd,Frezzle/xen-api,thomassa/xen-api,jjd27/xen-api,agimofcarmen/xen-api,koushikcgit/xcp-rrdd,johnelse/xcp-rrdd,salvocambria/xen-api,rafalmiel/xen-api,rafalmiel/xen-api,huizh/xen-api,cheng-z/xen-api,cheng--zhang/xen-api,jjd27/xen-api,huizh/xen-api,Frezzle/xen-api,srowe/xen-api,salvocambria/xen-api,anoobs/xen-api,vasilenkomike/xen-api,guard163/xen-api,agimofcarmen/xen-api,huizh/xen-api,cheng-z/xen-api,sharady/xcp-networkd,koushikcgit/xcp-networkd,robertbreker/xen-api,ravippandey/xen-api,koushikcgit/xcp-rrdd,cheng--zhang/xen-api,euanh/xen-api,vasilenkomike/xen-api,robertbreker/xen-api,anoobs/xen-api,vasilenkomike/xen-api,salvocambria/xen-api,cheng-z/xen-api,jjd27/xen-api,cheng--zhang/xen-api,vasilenkomike/xen-api,guard163/xen-api,salvocambria/xen-api,rafalmiel/xen-api,ravippandey/xen-api,koushikcgit/xen-api,koushikcgit/xcp-networkd,koushikcgit/xen-api,euanh/xen-api,thomassa/xen-api,vasilenkomike/xen-api,koushikcgit/xen-api,koushikcgit/xcp-rrdd,ravippandey/xen-api,jjd27/xen-api,thomassa/xen-api,simonjbeaumont/xen-api,huizh/xen-api,anoobs/xen-api,robertbreker/xen-api,cheng--zhang/xen-api,djs55/xcp-rrdd,cheng--zhang/xen-api,djs55/xcp-rrdd,koushikcgit/xen-api,ravippandey/xen-api