e347f2b9d0ec499617f1420bd841b7b05b48c90e
[sfa.git] / sfa / plc / sfa-nuke-plc.py
1 ##
2 # Delete all the database records for Geni. This tool is used to clean out Geni
3 # records during testing.
4 #
5 # Authority info (maintained by the hierarchy module in a subdirectory tree)
6 # is not purged by this tool and may be deleted by a command like 'rm'.
7 ##
8
9 import getopt
10 import sys
11
12 from sfa.trust.hierarchy import *
13 from sfa.util.record import *
14 from sfa.util.genitable import *
15 from sfa.util.config import *
16
17 def process_options():
18    global hrn
19
20    (options, args) = getopt.getopt(sys.argv[1:], '', [])
21    for opt in options:
22        name = opt[0]
23        val = opt[1]
24
25 def main():
26     process_options()
27
28     print "purging geni records from database"
29     geni_records_purge(get_default_dbinfo())
30
31 if __name__ == "__main__":
32     main()