15 l_nodes = plc.getNodes()
21 bootcds = soltesz.if_cached_else(1, "bootcds", lambda : {})
23 if not host in bootcds:
24 ssh = soltesz.SSH('root', host)
25 val = ssh.runE("F=/mnt/cdrom/bootme/ID;G=/usr/bootme/ID; if [ -f $F ] ; then cat $F ; else cat $G ; fi")
26 print "%s == %s" % (host, val)
28 elif "timed out" in bootcds[host]:
29 # Call again with a longer timeout!
30 opts = soltesz.ssh_options
31 opts['ConnectTimeout'] = '60'
32 ssh = soltesz.SSH('root', host, opts)
33 val = ssh.runE("F=/mnt/cdrom/bootme/ID;G=/usr/bootme/ID; if [ -f $F ] ; then cat $F ; else cat $G ; fi")
34 print "TO: %s == %s" % (host, val)
38 soltesz.dbDump("bootcds", bootcds)
40 if __name__ == '__main__':
45 print "Saving data... exitting."
46 soltesz.dbDump("bootcds", bootcds)