]> 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 01:21:05 +0000 (18:21 -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>
teuthology/nuke.py

index c3a8b8ecaf5d3b7275b786aa4c896b175f0ad451..8841edd83888eea12880a9586094e46103c6a1fa 100644 (file)
@@ -355,9 +355,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:
@@ -371,6 +372,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:
@@ -378,7 +380,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(
@@ -389,7 +392,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)