12 email = "soltesz@cs.utk.edu"
22 if os.path.exists(self.__file): # file exists, read that.
23 f = open(self.__file, 'r')
25 self.__dict__.update(o)
28 def getListFromFile(self, file):
37 f = open(self.__file, 'w')
38 o = {'debug': self.debug,
42 'userlist': self.userlist,
43 'cachert': self.cachert,
44 'cachenodes' : self.cachenodes,
45 'cachesites': self.cachesites,
46 'squeeze':self.squeeze,
47 'policysavedb':self.policysavedb}
53 config = __main__.config()
54 # --cachesites=[0|1] Cache Sites from PLC (current: %s)
55 # --status Print memory usage statistics and exit
58 --debug=[0|1] Set debugging (current: %s)
59 --mail=[0|1] Send mail or not (current: %s)
60 --bcc=[0|1] Include bcc of user (current: %s)
61 --email=[email] Email to use above (current: %s)
62 --userlist=[filename] Use a list of nodes (current: %s)
63 --cachert=[0|1] Cache the RT db (current: %s)
64 --cachenodes=[0|1] Cache Nodes from PLC (current: %s)
65 --squeeze=[0|1] Squeeze sites or not (current: %s)
66 --policysavedb=[0|1] Save policy DBs (current: %s)
67 -h, --help This message
68 """.lstrip() % (config.debug,
79 """ Start threads, do some housekeeping, then daemonize. """
81 config = __main__.config()
84 longopts = [ "debug=",
96 (opts, argv) = getopt.getopt(sys.argv[1:], "h", longopts)
97 except getopt.GetoptError, err:
98 print "Error: " + err.msg
102 for (opt, optval) in opts:
103 if opt in ["--debug"]:
104 config.debug = bool(int(optval))
105 print "Running in DEBUG mode. Copying DB & "
106 print "caching correspondences. NO SQUEEZING."
107 elif opt in ["--mail"]:
108 config.mail = bool(int(optval))
109 print "NO EMAILS SENT."
110 elif opt in ["--email"]:
111 config.email = optval
112 elif opt in ["--bcc"]:
113 config.bcc = bool(int(optval))
114 elif opt in ["--userlist"]:
116 config.userlist = None
118 config.userlist = optval
119 elif opt in ["--cachert"]:
120 config.cachert = bool(int(optval))
121 elif opt in ["--cachesites"]:
122 config.cachesites = bool(int(optval))
123 elif opt in ["--cachenodes"]:
124 config.cachenodes = bool(int(optval))
125 elif opt in ["--policysavedb"]:
126 config.policysavedb = bool(int(optval))
127 elif opt in ["--squeeze"]:
128 config.squeeze = bool(int(optval))
129 elif opt in ["--status"]:
130 #print summary(names)
140 if __name__ == '__main__':