From: Ian Campbell Date: Fri, 18 Jun 2010 12:38:25 +0000 (+0100) Subject: CA-41292: Provide XenAPIPlugins.Failure exception in order to compatibility X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=3ab440ef31109f035b7d92f7c5c04b65abd9fb92;p=xcp%2Fxen-api.git CA-41292: Provide XenAPIPlugins.Failure exception in order to compatibility with plugins written against previous versions of XenServer. This API was unintentionally removed in 90:85c10f6fab58 Signed-off-by: Ian Campbell diff -r 14a2a39f36c7 scripts/examples/python/XenAPIPlugin.py--- a/scripts/examples/python/XenAPIPlugin.py Wed May 12 10:52:22 2010 +0100 +++ b/scripts/examples/python/XenAPIPlugin.py Wed May 12 12:28:38 2010 +0100 @@ -4,6 +4,14 @@ import sys, xmlrpclib, XenAPI +class Failure(Exception): + """Provide compatibilty with plugins written against XenServer 5.5 API""" + + def __init__(self, code, params): + Exception.__init__(self) + self._params = [ code ] + params + def __str__(self): + return str(self._params) def success_message(result): rpcparams = { 'Status': 'Success', 'Value': result } ---