From 5897d7b95d63e9d89de86d2e6cbc5f121bb1bf88 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Wed, 3 Aug 2011 14:52:55 -0700 Subject: [PATCH] teuthology-nuke: run in parallel, and print each node being nuked --- teuthology/run.py | 54 +++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/teuthology/run.py b/teuthology/run.py index bebdb96ab7a80..e1b8ca2c7a7bf 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -193,30 +193,38 @@ def nuke(): log.info('Killing daemons, unmounting, and removing data...') from orchestra import run - ctx.cluster.run( - args=[ - 'killall', - '--quiet', - '/tmp/cephtest/binary/usr/local/bin/cmon', - '/tmp/cephtest/binary/usr/local/bin/cosd', - '/tmp/cephtest/binary/usr/local/bin/cmds', - '/tmp/cephtest/binary/usr/local/bin/cfuse', - run.Raw(';'), - 'if', 'test', '-e', '/etc/rsyslog.d/80-cephtest.conf', - run.Raw(';'), - 'then', - 'sudo', 'rm', '-f', '--', '/etc/rsyslog.d/80-cephtest.conf', - run.Raw('&&'), - 'sudo', 'initctl', 'restart', 'rsyslog', - run.Raw(';'), - 'fi', - run.Raw(';'), - 'find', '/tmp/cephtest', '-maxdepth', '1', '-name', 'mnt.*', - '-execdir', 'fusermount', '-u', '{}', ';', - run.Raw(';'), - 'sudo', 'rm', '-rf', '/tmp/cephtest', - ]) + nodes = {} + for remote in ctx.cluster.remotes.iterkeys(): + proc = remote.run( + args=[ + 'killall', + '--quiet', + '/tmp/cephtest/binary/usr/local/bin/cmon', + '/tmp/cephtest/binary/usr/local/bin/cosd', + '/tmp/cephtest/binary/usr/local/bin/cmds', + '/tmp/cephtest/binary/usr/local/bin/cfuse', + run.Raw(';'), + 'if', 'test', '-e', '/etc/rsyslog.d/80-cephtest.conf', + run.Raw(';'), + 'then', + 'sudo', 'rm', '-f', '--', '/etc/rsyslog.d/80-cephtest.conf', + run.Raw('&&'), + 'sudo', 'initctl', 'restart', 'rsyslog', + run.Raw(';'), + 'fi', + run.Raw(';'), + 'find', '/tmp/cephtest', '-maxdepth', '1', '-name', 'mnt.*', + '-execdir', 'fusermount', '-u', '{}', ';', + run.Raw(';'), + 'sudo', 'rm', '-rf', '/tmp/cephtest', + ], + wait=False, + ) + nodes[remote.name] = proc + for name, proc in nodes.iteritems(): + log.info('Waiting for %s to be nuked...', name) + proc.exitstatus.get() log.info('Done.') def schedule(): -- 2.39.5