mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 15:40:01 -06:00
29 lines
601 B
Python
Executable File
29 lines
601 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="admin"
|
|
kw = {'givenname':'Joe', 'sn':'Smith'}
|
|
result = server.user_add(args, kw)
|
|
print "returned %s" % result
|
|
except xmlrpclib.Fault, e:
|
|
print e.faultString
|
|
|
|
user_find("admin")
|
|
user_find("notfound")
|