+ # the agreement with the federica driver is for them to expose results in a way
+ # compliant with the avpi v2 return code, i.e. a dict with 'code' 'value' 'output'
+ # essentially, either 'code'==0, then 'value' is set to the actual result
+ # otherwise, 'code' is set to an error code and 'output' holds an error message
+ def response (self, from_xmlrpc):
+ if isinstance (from_xmlrpc, dict) and 'code' in from_xmlrpc:
+ if from_xmlrpc['code']==0:
+ return from_xmlrpc['value']
+ else:
+ raise SfaFault(from_xmlrpc['code'],from_xmlrpc['output'])
+ else:
+ logger.warning("unexpected result from federica xmlrpc api")
+ return from_xmlrpc
+