* Basic functionality in one file using only Python 2.4 std libs.
+ You can use the SSHJobMan class from classh in your own code. For example
+ here's a simple program to test that the time reported on a list of hosts
+ is consistent with the time on the localhost:
+ from classh import SSHJobMan
+ if __name__ == "__main__":
+ job = SSHJobMan(sys.argv[1:], 'date +%s')
+ for host, res in job.results.items():
+ print "Error getting date from %s" % host
+ rtime = int(res.output.strip())
+ print "Couldn't parse output for %s" % host
+ if (rtime - res.stopped) < 1 or res.started < rtime < res.stopped:
+ gap = res.stopped - res.started
+ print "Time on %s is nominal (+/- %g)" % (host, gap)
+ print "Time error on %s" % host
+ Note that only three lines (one import and the first two lines in the
+ __main__ block) are necessary to execute the job. The rest is just
+ processing the results.
* Why not multiprocessing module?
Links to Related Packages: