]> scripts.mit.edu Git - wizard.git/blobdiff - wizard/app/__init__.py
Reduce duplication in test scripts, more logging.
[wizard.git] / wizard / app / __init__.py
index 483f7ee30c01e8310eded59a8fd9993552747e30..ee9f58deab43bc4990e0fc234033d540bd4f8c45 100644 (file)
@@ -264,8 +264,12 @@ class Application(object):
         Checks if a given page of an autoinstall contains a particular string.
         """
         page = deployment.fetch(page)
-        logging.info("checkWebPage:\n\n" + page)
-        return page.find(output) != -1
+        result = page.find(output) != -1
+        if result:
+            logging.debug("checkWebPage (passed):\n\n" + page)
+        else:
+            logging.info("checkWebPage (failed):\n\n" + page)
+        return result
     def checkConfig(self, deployment):
         """
         Checks whether or not an autoinstall has been configured/installed
@@ -591,7 +595,8 @@ class Failure(Error):
 
 class InstallFailure(Error):
     """Installation failed for unknown reason."""
-    pass
+    def __str__(self):
+        return """Installation failed for unknown reason."""
 
 class RecoverableInstallFailure(InstallFailure):
     """
@@ -621,16 +626,11 @@ ERROR: Upgrade script failed, details:
 
 class UpgradeVerificationFailure(Failure):
     """Upgrade script passed, but website wasn't accessible afterwards"""
-    #: String details of failure (possibly stdout or stderr output)
-    details = None
-    def __init__(self, details):
-        self.details = details
     def __str__(self):
         return """
 
-ERROR: Upgrade script passed, but website wasn't accessible afterwards. Details:
-
-%s""" % self.details
+ERROR: Upgrade script passed, but website wasn't accessible afterwards.  Check
+the debug logs for the contents of the page."""
 
 class BackupFailure(Failure):
     """Backup script failed."""