]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
nuke: In containers, simply kill sshd
authorZack Cerza <zack@redhat.com>
Wed, 2 Feb 2022 02:07:53 +0000 (19:07 -0700)
committerZack Cerza <zack@redhat.com>
Mon, 28 Mar 2022 21:28:37 +0000 (15:28 -0600)
At least with the testnode containers I'm working on at the moment,
this appears to be the best way to shut them down from inside.

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

index e97bb1deb8125ae994767b5bbe46158df7dad896..47a96cd2ce3321182a66c18b52eb09418494ccd3 100644 (file)
@@ -314,19 +314,20 @@ def nuke_helper(ctx, should_unlock, keep_logs, should_reboot):
         if is_vm(shortname):
             return
     log.debug('shortname: %s' % shortname)
+    remote = Remote(host)
     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.check_lock(ctx, None, check_up=False)
     status = get_status(host)
     if status['machine_type'] in provision.fog.get_types():
-        remote = Remote(host)
         remote.console.power_off()
         return
     elif status['machine_type'] in provision.pelagos.get_types():
         provision.pelagos.park_node(host)
         return
-
+    elif remote.is_container:
+        remote.run(args=['sudo', 'killall', 'sshd'])
     if (not ctx.noipmi and 'ipmi_user' in config and
             'vpm' not in shortname):
         try: