From 809c9a2a855fec8bf1d297b0f6a014633011356e Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Wed, 17 Jun 2009 02:28:23 -0400 Subject: [PATCH] Make mass-migrate handle child error conditions. Signed-off-by: Edward Z. Yang --- lib/wizard/command/massmigrate.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/wizard/command/massmigrate.py b/lib/wizard/command/massmigrate.py index 070945f..f80c0a7 100644 --- a/lib/wizard/command/massmigrate.py +++ b/lib/wizard/command/massmigrate.py @@ -44,7 +44,16 @@ output going to stdout/stderr.""" if name != app: continue deploys.append(deploy) # parallelization code would go here + errors = {} for deploy in deploys: sub_argv = base_args + [deploy.location] logger.info("$ wizard migrate " + " ".join(sub_argv)) - migrate.migrate(sub_argv, global_options, logger) + try: + migrate.migrate(sub_argv, global_options, logger) + except UserException as e: + name = e.__class__.__name__ + if name not in errors: errors[name] = [] + errors[name].append(deploy) + logger.error("ERROR [%s] in %s" % (name, d.location)) + for name, deploys in errors.items(): + logger.warning("ERROR [%s] from %d installs" % (name, len(deploys))) -- 2.45.2