From 34ea939d2535d03c255eec26de114951e40110e2 Mon Sep 17 00:00:00 2001 From: Stephen Soltesz Date: Thu, 31 Jul 2008 20:40:57 +0000 Subject: [PATCH] deprecated. --- bootcds.py | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100755 bootcds.py 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) -- 2.43.0