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