mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Add some more supporting functions
Do a little bit more error handling and checking
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user