]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/command/upgrade.py
Fix web verification in MediaWiki and improve handling.
[wizard.git] / wizard / command / upgrade.py
index 969404379c57bd8a3e7d61e78507da170560a236..ed8c8ce645632a8b9e4ae7efee5dc5489d3df826 100644 (file)
@@ -18,6 +18,8 @@ def main(argv, baton):
         dir = "."
     shell.drop_priviledges(dir, options.log_file)
     util.chdir(dir)
+    if os.path.exists(".scripts/blacklisted"):
+        raise BlacklistedError()
     sh = shell.Shell()
     util.set_git_env()
     if options.continue_:
@@ -97,10 +99,11 @@ def main(argv, baton):
                 logging.warning("Upgrade failed: rolling back")
                 perform_restore(d, backup)
                 raise
-            except deploy.WebVerificationError:
+            except deploy.WebVerificationError as e:
                 logging.warning("Web verification failed: rolling back")
+                logging.info("Web page that was output was:\n\n%s" % e.contents)
                 perform_restore(d, backup)
-                raise app.UpgradeFailure("Upgrade caused website to become inaccessible; site was rolled back")
+                raise app.UpgradeVerificationFailure("Upgrade caused website to become inaccessible; site was rolled back")
     # XXX: frob .htaccess to make site accessible
     #       to do this, check if .htaccess changed, first.  Upgrade
     #       process might have frobbed it.  Don't be
@@ -233,3 +236,10 @@ The best way to resolve this is probably to attempt an upgrade again,
 with git rerere to remember merge resolutions (XXX: not sure if
 this actually works)."""
 
+class BlacklistedError(Error):
+    def __str__(self):
+        return """
+
+ERROR: This autoinstall was manually blacklisted against errors;
+if the user has not been notified of this, please send them
+mail."""