checking nuke.py back in under its new name
authorTony Mack <tmack@cs.princeton.edu>
Wed, 8 Jul 2009 18:23:26 +0000 (18:23 +0000)
committerTony Mack <tmack@cs.princeton.edu>
Wed, 8 Jul 2009 18:23:26 +0000 (18:23 +0000)
sfa/plc/sfa-nuke-plc.py [new file with mode: 0755]

diff --git a/sfa/plc/sfa-nuke-plc.py b/sfa/plc/sfa-nuke-plc.py
new file mode 100755 (executable)
index 0000000..e347f2b
--- /dev/null
@@ -0,0 +1,32 @@
+##
+# Delete all the database records for Geni. This tool is used to clean out Geni
+# records during testing.
+#
+# Authority info (maintained by the hierarchy module in a subdirectory tree)
+# is not purged by this tool and may be deleted by a command like 'rm'.
+##
+
+import getopt
+import sys
+
+from sfa.trust.hierarchy import *
+from sfa.util.record import *
+from sfa.util.genitable import *
+from sfa.util.config import *
+
+def process_options():
+   global hrn
+
+   (options, args) = getopt.getopt(sys.argv[1:], '', [])
+   for opt in options:
+       name = opt[0]
+       val = opt[1]
+
+def main():
+    process_options()
+
+    print "purging geni records from database"
+    geni_records_purge(get_default_dbinfo())
+
+if __name__ == "__main__":
+    main()