]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
nuke: honor 'check-locks: ...' field in targets file
authorSage Weil <sage@inktank.com>
Wed, 11 Jul 2012 21:23:51 +0000 (14:23 -0700)
committerSage Weil <sage@inktank.com>
Wed, 11 Jul 2012 21:23:51 +0000 (14:23 -0700)
If you are nuking a yaml file with check-locks: false, don't check locks.

teuthology/nuke.py

index 80e437777df9dd89c83c1839ffb83f8294c1624c..db4e514ac4b59a233424056c0010a7ab1437b77a 100644 (file)
@@ -300,6 +300,7 @@ def nuke(ctx, log, should_unlock, sync_clocks=True, reboot_all=True):
                 should_unlock,
                 sync_clocks,
                 reboot_all,
+                ctx.config.get('check-locks', True),
                 )
         for unnuked in p:
             if unnuked:
@@ -307,12 +308,13 @@ def nuke(ctx, log, should_unlock, sync_clocks=True, reboot_all=True):
     if total_unnuked:
         log.error('Could not nuke the following targets:\n' + '\n  '.join(['targets:', ] + yaml.safe_dump(total_unnuked, default_flow_style=False).splitlines()))
 
-def nuke_one(ctx, targets, log, should_unlock, synch_clocks, reboot_all):
+def nuke_one(ctx, targets, log, should_unlock, synch_clocks, reboot_all, check_locks):
     from teuthology.lock import unlock
     ret = None
     ctx = argparse.Namespace(
         config=dict(targets=targets),
         owner=ctx.owner,
+        check_locks=check_locks,
         synch_clocks=synch_clocks,
         reboot_all=reboot_all,
         teuthology_config=ctx.teuthology_config,
@@ -331,7 +333,8 @@ def nuke_one(ctx, targets, log, should_unlock, synch_clocks, reboot_all):
 
 def nuke_helper(ctx, log):
     from teuthology.task.internal import check_lock, connect
-    check_lock(ctx, None)
+    if ctx.check_locks:
+        check_lock(ctx, None)
     connect(ctx, None)
 
     log.info('Unmount ceph-fuse and killing daemons...')