#from sfa.util.faults import SfaNotImplemented, SfaAPIError, SfaInvalidAPIMethod, SfaFault
from sfa.util.faults import SfaInvalidAPIMethod, SfaAPIError, SfaFault
from sfa.util.sfalogging import logger
#from sfa.util.faults import SfaNotImplemented, SfaAPIError, SfaInvalidAPIMethod, SfaFault
from sfa.util.faults import SfaInvalidAPIMethod, SfaAPIError, SfaFault
from sfa.util.sfalogging import logger
-xmlrpclib.Marshaller._Marshaller__dump = xmlrpclib_dump
+# Note: not quite sure if this will still cause
+# the expected behaviour under python3
+xmlrpc_client.Marshaller._Marshaller__dump = xmlrpclib_dump
callablemethod = getattr(module, classname)(self)
return getattr(module, classname)(self)
except (ImportError, AttributeError):
callablemethod = getattr(module, classname)(self)
return getattr(module, classname)(self)
except (ImportError, AttributeError):
def call(self, source, method, *args):
"""
def call(self, source, method, *args):
"""
- interface = xmlrpclib
- self.protocol = 'xmlrpclib'
- (args, method) = xmlrpclib.loads(data)
- if method_map.has_key(method):
+ interface = xmlrpc_client
+ self.protocol = 'xmlrpc'
+ (args, method) = xmlrpc_client.loads(data)
+ if method in method_map:
- except SfaFault, fault:
- result = fault
- except Exception, fault:
+ except SfaFault as fault:
+ result = fault
+ self.logger.log_exc("XmlrpcApi.handle has caught Exception")
+ except Exception as fault:
- response = xmlrpclib.dumps(result, methodresponse = True, encoding = self.encoding, allow_none = 1)
+ response = xmlrpc_client.dumps(result, methodresponse = True, encoding = self.encoding, allow_none = 1)
elif self.protocol == 'soap':
if isinstance(result, Exception):
result = faultParameter(NS.ENV_T + ":Server", "Method Failed", method)
elif self.protocol == 'soap':
if isinstance(result, Exception):
result = faultParameter(NS.ENV_T + ":Server", "Method Failed", method)