8 XMLRPC_SERVER="https://boot.planet-lab.org/PLCAPI/"
14 email = "soltesz@cs.utk.edu"
24 if os.path.exists(self.__file): # file exists, read that.
25 f = open(self.__file, 'r')
27 self.__dict__.update(o)
30 def getListFromFile(self, file):
39 f = open(self.__file, 'w')
40 o = {'debug': self.debug,
44 'userlist': self.userlist,
45 'cachert': self.cachert,
46 'cachenodes' : self.cachenodes,
47 'cachesites': self.cachesites,
48 'squeeze':self.squeeze,
49 'policysavedb':self.policysavedb}
55 config = __main__.config()
56 # --cachesites=[0|1] Cache Sites from PLC (current: %s)
57 # --status Print memory usage statistics and exit
60 --debug=[0|1] Set debugging (current: %s)
61 --mail=[0|1] Send mail or not (current: %s)
62 --bcc=[0|1] Include bcc of user (current: %s)
63 --email=[email] Email to use above (current: %s)
64 --userlist=[filename] Use a list of nodes (current: %s)
65 --cachert=[0|1] Cache the RT db (current: %s)
66 --cachenodes=[0|1] Cache Nodes from PLC (current: %s)
67 --squeeze=[0|1] Squeeze sites or not (current: %s)
68 --policysavedb=[0|1] Save policy DBs (current: %s)
69 -h, --help This message
70 """.lstrip() % (config.debug,
81 """ Start threads, do some housekeeping, then daemonize. """
83 config = __main__.config()
86 longopts = [ "debug=",
98 (opts, argv) = getopt.getopt(sys.argv[1:], "h", longopts)
99 except getopt.GetoptError, err:
100 print "Error: " + err.msg
104 for (opt, optval) in opts:
105 if opt in ["--debug"]:
106 config.debug = bool(int(optval))
107 print "Running in DEBUG mode. Copying DB & "
108 print "caching correspondences. NO SQUEEZING."
109 elif opt in ["--mail"]:
110 config.mail = bool(int(optval))
111 print "NO EMAILS SENT."
112 elif opt in ["--email"]:
113 config.email = optval
114 elif opt in ["--bcc"]:
115 config.bcc = bool(int(optval))
116 elif opt in ["--userlist"]:
118 config.userlist = None
120 config.userlist = optval
121 elif opt in ["--cachert"]:
122 config.cachert = bool(int(optval))
123 elif opt in ["--cachesites"]:
124 config.cachesites = bool(int(optval))
125 elif opt in ["--cachenodes"]:
126 config.cachenodes = bool(int(optval))
127 elif opt in ["--policysavedb"]:
128 config.policysavedb = bool(int(optval))
129 elif opt in ["--squeeze"]:
130 config.squeeze = bool(int(optval))
131 elif opt in ["--status"]:
132 #print summary(names)
142 if __name__ == '__main__':