From 1b80f4aa1c06e791d7ca7b2f84884ea807fff6c1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 9 Dec 2013 11:42:12 -0800 Subject: [PATCH] nuke: ignore exceptions while issuing reboot command I'm seeing failed tasks (and nuke) leak machines. It looks like we are getting an exception on the '... reboot -f -n' command when we should be ignoring it and waiting for the machine to restart. For example: http://qa-proxy.ceph.com/teuthology/sage-2013-12-08_19:25:06-rados:thrash-wip-tier-foo-basic-plana/136321/teuthology.log Signed-off-by: Sage Weil --- teuthology/nuke.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/teuthology/nuke.py b/teuthology/nuke.py index 11089d6a4..4bedd8af6 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -148,16 +148,19 @@ def reboot(ctx, remotes): nodes = {} for remote in remotes: log.info('rebooting %s', remote.name) - proc = remote.run( # note use of -n to force a no-sync reboot - args=[ - 'sync', - run.Raw('&'), - 'sleep', '5', - run.Raw(';'), - 'sudo', 'reboot', '-f', '-n' - ], - wait=False - ) + try: + proc = remote.run( # note use of -n to force a no-sync reboot + args=[ + 'sync', + run.Raw('&'), + 'sleep', '5', + run.Raw(';'), + 'sudo', 'reboot', '-f', '-n' + ], + wait=False + ) + except Exception: + log.exception('ignoring exception during reboot command') nodes[remote] = proc # we just ignore these procs because reboot -f doesn't actually # send anything back to the ssh client! -- 2.47.3