defstatus(): all = [(host, tmpnam(host, name)) for host, name in servers] index = 0 counts = 0 for host, path in all: probe_snapshot_sql(host, path) if index > 0: file = platform.popen('diff -p %s %s' % (all[0][1], all[index][1]), 'r') different = file.readlines() file.close() if len(different) != 0: if counts != 0: print '\n%s\n' % ('/' * 80, ) sys.stdout.writelines(different) counts = counts + 1 index = index + 1
defclear(): for host, name in servers: try: os.unlink(tmpnam(host, name)) except: pass
key = sys.argv[1].upper() for command in (export, status, clear): if command.__name__.upper().startswith(key): command() break