Add some more supporting functions

Do a little bit more error handling and checking
This commit is contained in:
Rob Crittenden
2008-10-07 02:10:15 -04:00
parent cb795fa14b
commit 69bc5ad77a
4 changed files with 61 additions and 10 deletions

View File

@@ -24,6 +24,7 @@ Lightwieght XML-RPC client using Python standard library xmlrpclib.
"""
import xmlrpclib
import socket
from ipalib.backend import Backend
from ipalib.util import xmlrpc_marshal
from ipalib import api
@@ -44,7 +45,10 @@ class xmlrpc(Backend):
client = self.get_client()
command = getattr(client, name)
params = xmlrpc_marshal(*args, **kw)
return command(*params)
# return command(*args, **kw)
try:
return command(*params)
except socket.error, e:
print e[1]
return False
api.register(xmlrpc)