]> scripts.mit.edu Git - wizard.git/blobdiff - plugins/scripts/wizard_scripts.py
Schlep around database handling functions to wizard.sql, add wizard.sql.drop hook.
[wizard.git] / plugins / scripts / wizard_scripts.py
index a3c5a41d704b3f196b3cc918efd2a50c4c22a37e..648d8a7a08c6aa46e04ae17de2ee98bb8e40ccb6 100644 (file)
@@ -123,6 +123,15 @@ def sql_auth(url):
             pass
     return None
 
+def sql_drop(url):
+    if url.host == "sql.mit.edu":
+        try:
+            shell.call("/mit/scripts/sql/bin/drop-database", url.database)
+            return True
+        except shell.CallError:
+            pass
+    return None
+
 def user_email(name):
     # XXX: simplistic install which doesn't work most of the time
     return "%s@scripts.mit.edu" % name