2006-04-15 22:00:23 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
# XML-RPC-Client
|
|
|
|
# (c) 2006 Jan Dittberner
|
|
|
|
# version: $Id$
|
|
|
|
#
|
|
|
|
from xmlrpclib import ServerProxy
|
|
|
|
import logging, sys
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
server = ServerProxy('http://localhost:8080')
|
|
|
|
logger = logging.getLogger()
|
|
|
|
logging.basicConfig()
|
|
|
|
|
2006-04-17 21:20:14 +02:00
|
|
|
sessionid = None
|
2006-04-15 22:00:23 +02:00
|
|
|
try:
|
|
|
|
sessionid = server.login('jan', 'heyyou97')
|
|
|
|
if sessionid:
|
2006-04-17 21:20:14 +02:00
|
|
|
print "Session %s" % sessionid
|
|
|
|
print server.listdomains(sessionid)
|
|
|
|
server.logout(sessionid)
|
2006-04-15 22:00:23 +02:00
|
|
|
else:
|
|
|
|
print "login failed"
|
|
|
|
except Exception, v:
|
|
|
|
logger.exception(v)
|
2006-04-17 21:20:14 +02:00
|
|
|
if sessionid is not None:
|
|
|
|
try:
|
|
|
|
server.logout(sessionid)
|
|
|
|
except Exception, vn:
|
|
|
|
logger.exception(vn)
|