From 081051a3fa54a062e5ed257b977488e3baf75f78 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sun, 7 Feb 2010 20:59:17 -0500 Subject: [PATCH] Add reporting for db, quota and permissions errors. Signed-off-by: Edward Z. Yang --- wizard/command/mass_upgrade.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/wizard/command/mass_upgrade.py b/wizard/command/mass_upgrade.py index 90724fe..0f02abe 100644 --- a/wizard/command/mass_upgrade.py +++ b/wizard/command/mass_upgrade.py @@ -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) -- 2.45.2