1 # a rough utility for testing xmlrpclib URL's
3 auth={'AuthMethod':'password','Username':'root@test.onelab.eu','AuthString':'test++'}
8 hostname="%s.pl.sophia.inria.fr"%host
9 ip=socket.gethostbyname(hostname)
14 def try_url (url,xmlrpclib_verbose=False):
16 xmlrpclib.ServerProxy (url, verbose=xmlrpclib_verbose, allow_none=True).GetNodes(auth)
18 except xmlrpclib.ProtocolError as e:
19 print '... (http error %s)'%e.errcode,url
20 except Exception as e:
21 print '---',type(e).__name__,url
22 if verbose: traceback.print_exc()
25 for protocol in ['http','https']:
26 for dest in [ hostname, ip ]:
27 for port in [ '',':80',':443']:
28 # for port in [ ':80',':443']:
29 for path in ['PLCAPI','PLCAPI/']:
30 if protocol=='http' and port==':443': continue
31 if protocol=='https' and port==':80': continue
32 url="%s://%s%s/%s"%(protocol,dest,port,path)