app = args[0]
base_args = calculate_base_args(options)
sh = shell.ParallelShell.make(options.no_parallelize, options.max_processes)
+ command.create_logdir(options.log_dir)
seen = sset.make(options.seen)
is_root = not os.getuid()
- warnings_log, errors_log = command.open_logs(options.log_dir)
+ report = command.open_reports(options.log_dir)
# loop stuff
errors = {}
i = 0
child_args = list(base_args)
# calculate the log file, if a log dir was specified
if options.log_dir:
- log_file = command.calculate_log_name(options.log_dir, i, d.location)
+ log_file = command.calculate_log_name(options.log_dir, i)
child_args.append("--log-file=" + log_file)
# actual meat
def make_on_pair(d, i):
# we need to make another stack frame so that d and i get specific bindings.
def on_success(stdout, stderr):
if stderr:
- warnings_log.write("%s\n" % d.location)
+ report.warnings.write("%s\n" % d.location)
logging.warning("Warnings [%04d] %s:\n%s" % (i, d.location, stderr))
seen.add(d.location)
def on_error(e):
if name not in errors: errors[name] = []
errors[name].append(d)
logging.error("%s in [%04d] %s" % (name, i, d.location))
- errors_log.write("%s\n" % d.location)
+ report.errors.write("%s\n" % d.location)
return (on_success, on_error)
on_success, on_error = make_on_pair(d, i)
sh.call("wizard", "migrate", d.location, *child_args,
parser.error("too many arguments")
elif not args:
parser.error("must specify application to migrate")
- if options.dry_run:
- options.no_parallelize = True
return options, args
def calculate_base_args(options):