From: Edward Z. Yang Date: Sun, 4 Oct 2009 05:04:14 +0000 (-0400) Subject: Implement 'wizard blacklist', tweaks. X-Git-Url: https://scripts.mit.edu/gitweb/wizard.git/commitdiff_plain/e6d48a8c1e7425dd14f839e3c6ba26588462a34f Implement 'wizard blacklist', tweaks. Signed-off-by: Edward Z. Yang --- diff --git a/TODO b/TODO index 0f6930d..8679fbb 100644 --- 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 diff --git a/bin/wizard b/bin/wizard index e00eb8f..97322ef 100755 --- a/bin/wizard +++ b/bin/wizard @@ -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", diff --git a/wizard/app/mediawiki.py b/wizard/app/mediawiki.py index d07b1e7..d21ee15 100644 --- a/wizard/app/mediawiki.py +++ b/wizard/app/mediawiki.py @@ -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 index 0000000..36b2a98 --- /dev/null +++ b/wizard/command/blacklist.py @@ -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 +