import repository from arizona
[raven.git] / tools / testnodes / test_getsshkeys_remote.py
1 #! /usr/bin/python
2 import xmlrpclib,socket,os,time
3
4 def commasub(x):
5     return x.replace(",",";")
6
7 tnow = time.time()
8 try:
9     bootdate = os.stat("/var/log/boot.log")[7]
10     uptime = tnow - bootdate
11 except:
12     bootdate = 0
13     uptime = 0
14
15 try:
16     glo_all_slice_keys = xmlrpclib.ServerProxy('http://localhost:812/').GetSSHKeys()
17     status = "success"
18     error = ""
19 except Exception, e:
20     status = "failure"
21     error = str(e)
22
23 print "status=" + status + ",node=" + socket.gethostname() + ",error=" + \
24       commasub(error) + ",bootdate=" + str(bootdate) + ",uptime=" + \
25       str(uptime) + ",time=" + str(tnow) + ",uid=" + str(os.getuid())
26