]> scripts.mit.edu Git - wizard.git/commitdiff
Add reporting for db, quota and permissions errors.
authorEdward Z. Yang <ezyang@mit.edu>
Mon, 8 Feb 2010 01:59:17 +0000 (20:59 -0500)
committerEdward Z. Yang <ezyang@mit.edu>
Tue, 9 Mar 2010 02:41:31 +0000 (21:41 -0500)
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
wizard/command/mass_upgrade.py

index 90724fea936df66c98ad7d0df0a52bb24a106f92..0f02abed13c7b7ceef6ffd34bbf39979feaf13cf 100644 (file)
@@ -22,6 +22,9 @@ def main(argv, baton):
         'verify': 'had web verification errors',
         'backup_failure': 'had a backup failure',
         'blacklisted': 'were blacklisted',
+        'db': 'had database errors',
+        'quota': 'had too low quota',
+        'permissions': 'had insufficient permissions for upgrade'
     }
     if options.remerge:
         os.unlink(os.path.join(options.log_dir, 'merge.txt'))
@@ -98,12 +101,21 @@ def main(argv, baton):
                         # This should actually be a warning, but it's a really common error
                         logging.info("[%04d] Could not verify application at %s", i, url)
                         status.write("verify", i, url)
+                    elif e.name == "DatabaseVerificationError":
+                        logging.info("[%04d] Could not verify database ast %s", i, d.location)
+                        status.write("db", i, d.location)
                     elif e.name == "NotMigratedError":
                         logging.info("[%04d] Application not migrated at %s", i, d.location)
                         status.write("not_migrated", i, d.location)
                     elif e.name == "BackupFailure":
                         logging.info("[%04d] Failed backups at %s", i, d.location)
                         status.write("backup_failure", i, d.location)
+                    elif e.name == "QuotaTooLow":
+                        logging.info("[%04d] Quota too low at %s", i, d.location)
+                        status.write("quota", i, d.location)
+                    elif e.name == "PermissionsError":
+                        logging.info("[%04d] Insufficient permissions to upgrade %s", i, d.location)
+                        status.write("permissions", i, d.location)
                     else:
                         errors.setdefault(e.name, []).append(d)
                         logging.error("[%04d] %s in %s", i, e.name, d.location)
@@ -119,8 +131,9 @@ def main(argv, baton):
         for name, deploys in errors.items():
             logging.warning("%s from %d installs", name, len(deploys))
         print
+        total = sum(len(x.values) for x in status.reports.values())
         def printPercent(description, number):
-            print "% 4d out of % 4d installs (% 5.1f%%) %s" % (number, i, float(number)/i*100, description)
+            print "% 4d out of % 4d installs (% 5.1f%%) %s" % (number, total, float(number)/total*100, description)
         error_count = sum(len(e) for e in errors.values())
         if error_count:
             printPercent("had unusual errors", error_count)