nuke: In containers, simply kill sshd
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.
@@ -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:
