freeipa/ipaserver/test_client

29 lines
607 B
Python
Executable File

#!/usr/bin/python
import xmlrpclib
def user_find(uid):
try:
args=uid
result = server.user_find(args)
print "returned %s" % result
except xmlrpclib.Fault, e:
print e.faultString
# main
server = xmlrpclib.ServerProxy("http://localhost:8888/")
#print server.system.listMethods()
#print server.system.methodHelp("user_add")
try:
args="jsmith1"
kw = {'givenname':'Joe', 'sn':'Smith'}
result = server.user_add(kw, args)
print "returned %s" % result
except xmlrpclib.Fault, e:
print e.faultString
#user_find("admin")
#user_find("notfound")