]> scripts.mit.edu Git - wizard.git/commitdiff
Implement 'wizard blacklist', tweaks.
authorEdward Z. Yang <ezyang@mit.edu>
Sun, 4 Oct 2009 05:04:14 +0000 (01:04 -0400)
committerEdward Z. Yang <ezyang@mit.edu>
Sun, 4 Oct 2009 05:04:14 +0000 (01:04 -0400)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
TODO
bin/wizard
wizard/app/mediawiki.py
wizard/command/blacklist.py [new file with mode: 0644]

diff --git a/TODO b/TODO
index 0f6930df6be526d30bdae5c123a56a2a093d24a3..8679fbbbd0fcfd764508e82f700042bd26f03046 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,6 +2,11 @@ The Git Autoinstaller
 
 TODO NOW:
 
+- Wipe temp directories if the upgrade succeeds
+- Put temp directories on tmpfs before merging, then move to disk if it
+  fails
+- Fix exception parsing when we print HTML
+
 - Implement "group" filtering using blanche for limited rollouts.
 
 - Remove "already migrated" cruft that will accumulate if we do small
index e00eb8ff8fbf367e526c623851dd6cf0f56c6dc4..97322efb50bde79b56230702dfe5fdc39fa51c45 100755 (executable)
@@ -22,6 +22,7 @@ User commands:
     upgrade         Upgrades an autoinstall to the latest version
 
 Administrative commands:
+    blacklist       Marks an autoinstall to not try upgrades
     errors          Lists all broken autoinstall metadata
     list            Lists autoinstalls, with optional filtering
     mass-migrate    Performs mass migration of autoinstalls of an application
@@ -55,7 +56,7 @@ See '%prog help COMMAND' for more information on a specific command."""
     baton.add("--no-parallelize", dest="no_parallelize", action="store_true",
             default=False, help="Turn off parallelization")
     baton.add("--max-processes", dest="max_processes", type="int", metavar="N",
-            default=40, help="Maximum subprocesses to run concurrently")
+            default=10, help="Maximum subprocesses to run concurrently")
     baton.add("--limit", dest="limit", type="int",
             default=None, help="Limit the number of autoinstalls to look at.")
     baton.add("--user", "-u", dest="user",
index d07b1e7f13576fbb474a9c585f13f5d10526c0d9..d21ee156ed459ed8ba44d0ce635f3bc480ddb3a6 100644 (file)
@@ -113,6 +113,7 @@ class Application(deploy.Application):
             sh.call("mysqldump", "--compress", "-r", outfile, *get_mysql_args(deployment))
             sh.call("gzip", "--best", outfile)
         except shell.CallError as e:
+            shutil.rmtree(outdir)
             raise app.BackupFailure(e.stderr)
         return backup
     def restore(self, deployment, backup, options):
diff --git a/wizard/command/blacklist.py b/wizard/command/blacklist.py
new file mode 100644 (file)
index 0000000..36b2a98
--- /dev/null
@@ -0,0 +1,30 @@
+import logging
+import os
+import optparse
+import sys
+import distutils.version
+
+from wizard import command, deploy, git, shell, util
+
+def main(argv, baton):
+    options, args = parse_args(argv, baton)
+    if not args:
+        reason = ""
+    else:
+        reason = args[0]
+    sh = shell.Shell()
+    if os.path.exists(".git/WIZARD_REPO"):
+        util.chdir(sh.eval('git', 'config', 'remote.origin.url'))
+    open('.scripts/blacklisted', 'w').write(reason + "\n")
+
+def parse_args(argv, baton):
+    usage = """usage: %prog blacklist [ARGS] [REASON]
+
+Touches .scripts/blacklisted so that we don't attempt
+to upgrade the script in the future."""
+    parser = command.WizardOptionParser(usage)
+    options, args = parser.parse_all(argv)
+    if len(args) > 1:
+        parser.error("too many arguments")
+    return options, args
+