]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
nuke: make half-hearted attempt to sync before reboot 116/head
authorSage Weil <sage@inktank.com>
Tue, 1 Oct 2013 16:57:34 +0000 (09:57 -0700)
committerSage Weil <sage@inktank.com>
Tue, 1 Oct 2013 16:57:34 +0000 (09:57 -0700)
We don't want to block on sync for fear of a hung kernel
mount.  However, we can give it a try and wait a few seconds
to get what we can.

This fixes a problem where our recent modifications to the
sudoers file are lost, with a 0 byte file left in its place,
because the task fails and we do a reboot -f -n.

Signed-off-by: Sage Weil <sage@inktank.com>
teuthology/nuke.py

index ed9252d93190e75005624afb1fdb9d9fa9c5bbeb..8dfaee0cd4a7004f0d7e56bab1548b5a53390cb2 100644 (file)
@@ -197,12 +197,17 @@ def remove_osd_tmpfs(ctx, log):
         )
 
 def reboot(ctx, remotes, log):
+    from .orchestra import run
     import time
     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=['sudo', 'reboot', '-f', '-n'],
+            args=[
+                'timeout', '5', 'sync',
+                run.Raw(';'),
+                'sudo', 'reboot', '-f', '-n'
+                ],
             wait=False
             )
         nodes[remote] = proc