From: Stephen Soltesz Date: Thu, 31 Jul 2008 20:40:57 +0000 (+0000) Subject: deprecated. X-Git-Tag: Monitor-1.0-6~39 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=34ea939d2535d03c255eec26de114951e40110e2;p=monitor.git deprecated. --- diff --git a/bootcds.py b/bootcds.py deleted file mode 100755 index a7189ca..0000000 --- a/bootcds.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/python - -import os -import sys -import string -import time -import soltesz -import plc - -bootcds = {} - -def main(): - global bootcds - - l_nodes = plc.getNodes() - d_nodes = {} - for host in l_nodes: - h = host['hostname'] - d_nodes[h] = host - - bootcds = soltesz.if_cached_else(1, "bootcds", lambda : {}) - for host in d_nodes: - if not host in bootcds: - ssh = soltesz.SSH('root', host) - val = ssh.runE("F=/mnt/cdrom/bootme/ID;G=/usr/bootme/ID; if [ -f $F ] ; then cat $F ; else cat $G ; fi") - print "%s == %s" % (host, val) - bootcds[host] = val - elif "timed out" in bootcds[host]: - # Call again with a longer timeout! - opts = soltesz.ssh_options - opts['ConnectTimeout'] = '60' - ssh = soltesz.SSH('root', host, opts) - val = ssh.runE("F=/mnt/cdrom/bootme/ID;G=/usr/bootme/ID; if [ -f $F ] ; then cat $F ; else cat $G ; fi") - print "TO: %s == %s" % (host, val) - bootcds[host] = val - - - soltesz.dbDump("bootcds", bootcds) - -if __name__ == '__main__': - import os - try: - main() - except Exception: - print "Saving data... exitting." - soltesz.dbDump("bootcds", bootcds) - sys.exit(0)