From: Zack Cerza Date: Tue, 28 Nov 2017 16:52:53 +0000 (-0700) Subject: lock.ops.lock_many: Log console while reimaging X-Git-Tag: 1.1.0~375^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1acb0b69d767bd921ff09c3981554623fcab6a74;p=teuthology.git lock.ops.lock_many: Log console while reimaging Signed-off-by: Zack Cerza --- diff --git a/teuthology/lock/ops.py b/teuthology/lock/ops.py index 71581ef4d9..502297f454 100644 --- a/teuthology/lock/ops.py +++ b/teuthology/lock/ops.py @@ -4,11 +4,13 @@ import os import requests +import teuthology.orchestra.remote import teuthology.parallel import teuthology.provision from teuthology import misc from teuthology.config import config from teuthology.contextutil import safe_while +from teuthology.task import console_log import util import keys @@ -110,10 +112,17 @@ def lock_many(ctx, num, machine_type, user=None, description=None, return ok_machs elif machine_type in reimage_types: reimaged = dict() - with teuthology.parallel.parallel() as p: - for machine in machines: - p.spawn(teuthology.provision.reimage, ctx, machine) - reimaged[machine] = machines[machine] + console_log_conf = dict( + logfile_name='{shortname}_reimage.log', + remotes=[teuthology.orchestra.remote.Remote(machine) + for machine in machines], + ) + with console_log.task( + ctx, console_log_conf): + with teuthology.parallel.parallel() as p: + for machine in machines: + p.spawn(teuthology.provision.reimage, ctx, machine) + reimaged[machine] = machines[machine] reimaged = keys.do_update_keys(reimaged.keys())[1] return reimaged return machines