review logging again; code that runs in client and/or server now logs in the right...
[sfa.git] / sfa / plc / sfa-nuke-plc.py
index eac6ed7..bdc3892 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 ##
-# Delete all the database records for Geni. This tool is used to clean out Geni
+# Delete all the database records for SFA. This tool is used to clean out SFA
 # records during testing.
 #
 # Authority info (maintained by the hierarchy module in a subdirectory tree)
@@ -12,8 +12,8 @@ import sys
 
 from sfa.trust.hierarchy import *
 from sfa.util.record import *
-from sfa.util.genitable import GeniTable
-from sfa.util.config import Config
+from sfa.util.table import SfaTable
+from sfa.util.sfalogging import sfa_logger_goes_to_import,sfa_logger
 
 def process_options():
 
@@ -24,9 +24,10 @@ def process_options():
 
 def main():
     process_options()
-
-    print "purging geni records from database"
-    GeniTable.geni_records_purge(Config().get_plc_dbinfo())
+    sfa_logger_goes_to_import()
+    sfa_logger().info("Purging SFA records from database")
+    table = SfaTable()
+    table.sfa_records_purge()
 
 if __name__ == "__main__":
     main()