]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
nuke: don't require noipmi in ctx
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 10 May 2013 01:20:59 +0000 (18:20 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Fri, 10 May 2013 08:14:52 +0000 (01:14 -0700)
This is called from run.py too, which won't have ctx.noipmi.
The default of using impmi is fine for now for run.py.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
(cherry picked from commit d7fe5c0a3418355a487d65b96ad26aa181687ff8)

teuthology/nuke.py

index 5ed0662f9ceb00b4d05a18e0e080a336356b7de9..e4ed91b567d517429d34b9afea153c40234aa461 100644 (file)
@@ -366,9 +366,10 @@ def main():
             import subprocess
             subprocess.check_call(["kill", "-9", str(ctx.pid)]);
 
-    nuke(ctx, log, ctx.unlock, ctx.synch_clocks, ctx.reboot_all)
+    nuke(ctx, log, ctx.unlock, ctx.synch_clocks, ctx.reboot_all, ctx.noipmi)
 
-def nuke(ctx, log, should_unlock, sync_clocks=True, reboot_all=True):
+def nuke(ctx, log, should_unlock, sync_clocks=True, reboot_all=True,
+         noipmi=False):
     from teuthology.parallel import parallel
     total_unnuked = {}
     with parallel() as p:
@@ -382,6 +383,7 @@ def nuke(ctx, log, should_unlock, sync_clocks=True, reboot_all=True):
                 sync_clocks,
                 reboot_all,
                 ctx.config.get('check-locks', True),
+                noipmi,
                 )
         for unnuked in p:
             if unnuked:
@@ -389,7 +391,8 @@ 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, check_locks):
+def nuke_one(ctx, targets, log, should_unlock, synch_clocks, reboot_all,
+             check_locks, noipmi):
     from teuthology.lock import unlock
     ret = None
     ctx = argparse.Namespace(
@@ -400,7 +403,7 @@ def nuke_one(ctx, targets, log, should_unlock, synch_clocks, reboot_all, check_l
         reboot_all=reboot_all,
         teuthology_config=ctx.teuthology_config,
         name=ctx.name,
-        noipmi=ctx.noipmi,
+        noipmi=noipmi,
         )
     try:
         nuke_helper(ctx, log)