]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Don't assert status==up when using internal.check_lock. 478/head
authorAndrew Schoen <aschoen@redhat.com>
Wed, 29 Apr 2015 15:43:52 +0000 (11:43 -0400)
committerAndrew Schoen <aschoen@redhat.com>
Wed, 29 Apr 2015 16:59:03 +0000 (11:59 -0500)
Add a check_up kwarg to check_lock so that we can optionally skip
checking to see if a node is up before nuking it. This still allows
scheduled teuthology jobs to make sure they didn't lock a downed node.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
teuthology/nuke.py
teuthology/task/internal.py

index 2b34e8404b23dbd46f20f5c9832d2d3847b79bd2..af02a6085f54ddc7697a590df7717483e1db85de 100644 (file)
@@ -497,7 +497,9 @@ def nuke_helper(ctx, should_unlock):
             log.info('console ready on %s' % cname)
 
     if ctx.check_locks:
-        check_lock(ctx, None)
+        # does not check to ensure if the node is 'up'
+        # we want to be able to nuke a downed node
+        check_lock(ctx, None, check_up=False)
     add_remotes(ctx, None)
     connect(ctx, None)
 
index e850be4991c070bb0fb4c9057f7318260aab9dc8..ce49b2ff71b57507f2a074d59d0ba74ee06fd305 100644 (file)
@@ -184,7 +184,7 @@ def save_config(ctx, config):
         with file(os.path.join(ctx.archive, 'config.yaml'), 'w') as f:
             yaml.safe_dump(ctx.config, f, default_flow_style=False)
 
-def check_lock(ctx, config):
+def check_lock(ctx, config, check_up=True):
     """
     Check lock status of remote machines.
     """
@@ -197,7 +197,10 @@ def check_lock(ctx, config):
         log.debug('machine status is %s', repr(status))
         assert status is not None, \
             'could not read lock status for {name}'.format(name=machine)
-        assert status['up'], 'machine {name} is marked down'.format(name=machine)
+        if check_up:
+            assert status['up'], 'machine {name} is marked down'.format(
+                name=machine
+            )
         assert status['locked'], \
             'machine {name} is not locked'.format(name=machine)
         assert status['locked_by'] == ctx.owner, \