]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Check locks before doing anything else 935/head
authorZack Cerza <zack@redhat.com>
Wed, 17 Aug 2016 15:43:55 +0000 (09:43 -0600)
committerZack Cerza <zack@redhat.com>
Wed, 17 Aug 2016 15:43:55 +0000 (09:43 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/nuke/__init__.py

index 391f220740455f0b9dfdd94b94bff7b8116fbed3..df7766dff44dec257d168e6ff8bb6b22bc55466a 100644 (file)
@@ -295,6 +295,10 @@ def nuke_helper(ctx, should_unlock):
             return
     log.debug('shortname: %s' % shortname)
     log.debug('{ctx}'.format(ctx=ctx))
+    if ctx.check_locks:
+        # 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)
     if (not ctx.noipmi and 'ipmi_user' in config and
             'vpm' not in shortname):
         try:
@@ -305,10 +309,6 @@ def nuke_helper(ctx, should_unlock):
             remote = Remote(host)
             remote.connect()
 
-    if ctx.check_locks:
-        # 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)