]> scripts.mit.edu Git - wizard.git/commitdiff
Rename NonfatalFailure to RecoverableFailure.
authorEdward Z. Yang <ezyang@mit.edu>
Tue, 10 Nov 2009 05:37:33 +0000 (00:37 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Tue, 10 Nov 2009 05:37:33 +0000 (00:37 -0500)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
tests/setup
wizard/app/__init__.py
wizard/app/mediawiki.py

index 3ba48c1fda6c788e682434e6cb109abbb3f28dcc..bac28b43c24be0ad39af0fc8fbc43bdd2ef1a741 100644 (file)
@@ -18,8 +18,12 @@ UVERSION=`echo "$VERSION" | sed s/[-.]/_/g`
 TESTID="${TESTNAME}_$UVERSION"
 echo "$TESTID"
 TESTDIR="testdir_${TESTNAME}_$VERSION"
-export WIZARD_ADMIN_NAME="admin"
-export WIZARD_ADMIN_PASSWORD="wizard"
+if [ "$WIZARD_ADMIN_NAME" == "" ]; then
+    export WIZARD_ADMIN_NAME="admin"
+fi
+if [ "$WIZARD_ADMIN_PASSWORD" == "" ]; then
+    export WIZARD_ADMIN_PASSWORD="wizard"
+fi
 
 if [ -e "config" ]; then
     source ./config
index adb9a189b6be8bbd58f557c5c47b781c888c2306..4ec8ea61a917eeb669282a365db32eac1653a564 100644 (file)
@@ -522,9 +522,18 @@ class Error(wizard.Error):
     """Generic error class for this module."""
     pass
 
-class NonfatalFailure(Error):
-    """Bad parameters given to installer."""
-    pass
+class RecoverableFailure(Error):
+    """
+    The installer failed, but we were able to determine what the
+    error was, and should give the user a second chance if we were
+    running interactively.
+    """
+    #: List of the errors that were found.
+    errors = None
+    def __init__(self, errors):
+        self.errors = errors
+    def __str__(self):
+        return """Installation failed due to the following errors: %s""" % ", ".join(self.errors)
 
 class NoRepositoryError(Error):
     """
index 4e36c9c3e86d504a0ab43d5468565b44f62f2679..1de77df95430c46218664ebd2498b6cc2d37a803 100644 (file)
@@ -76,7 +76,7 @@ class Application(app.Application):
         if result.find("Installation successful") == -1:
             if not error_messages:
                 raise install.Failure()
-            raise app.NonfatalFailure(error_messages)
+            raise app.RecoverableFailure(error_messages)
         os.rename('config/LocalSettings.php', 'LocalSettings.php')
     def upgrade(self, d, version, options):
         sh = shell.Shell()