]> xenbits.xensource.com Git - xcp/xen-api.git/commitdiff
CA-41292: Provide XenAPIPlugins.Failure exception in order to compatibility
authorIan Campbell <ian.campbell@citrix.com>
Fri, 18 Jun 2010 12:38:25 +0000 (13:38 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 18 Jun 2010 12:38:25 +0000 (13:38 +0100)
with plugins written against previous versions of XenServer.

This API was unintentionally removed in 90:85c10f6fab58

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
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 }


No differences found