]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
nuke: Reimage instead of nuking as necessary
authorZack Cerza <zack@redhat.com>
Thu, 30 Nov 2017 00:22:38 +0000 (17:22 -0700)
committerZack Cerza <zack@redhat.com>
Thu, 30 Nov 2017 19:15:42 +0000 (12:15 -0700)
Once this branch is in master, we'll probably want to switch this
behavior to no-op nodes that would be reimaged, since the next job will
do that anyway.

Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/nuke/__init__.py

index 2e6ac85db2b66d08f21d12893554db24b6a7d7a7..f172c4cafd226e34fa6e379381daf1b41152ac8a 100644 (file)
@@ -8,9 +8,10 @@ import subprocess
 import yaml
 
 import teuthology
-from teuthology.lock.ops import unlock_one
+from teuthology import provision
+from teuthology.lock.ops import unlock_one, update_inventory
 from teuthology.lock.query import is_vm, list_locks, \
-    find_stale_locks
+    find_stale_locks, get_status
 from teuthology.lock.util import locked_since_seconds
 from .actions import (
     check_console, clear_firewall, shutdown_daemons, remove_installed_packages,
@@ -301,6 +302,13 @@ def nuke_helper(ctx, should_unlock):
         # does not check to ensure if the node is 'up'
         # we want to be able to nuke a downed node
         check_lock.check_lock(ctx, None, check_up=False)
+    status = get_status(host)
+    if status['machine_type'] in provision.fog.get_types():
+        fog_obj = provision.fog.FOG(
+            host, status['os_type'], status['os_version'])
+        fog_obj.create()
+        update_inventory(fog_obj.remote.inventory_info)
+        return
     if (not ctx.noipmi and 'ipmi_user' in config and
             'vpm' not in shortname):
         try: