ssh_box: Shutdown container when fail to start ssh session (#1872)

This commit is contained in:
Boxuan Li
2024-05-18 02:04:38 -07:00
committed by GitHub
parent f0ce2ffabf
commit 0abc35cf57

View File

@@ -253,7 +253,13 @@ class DockerSSHBox(Sandbox):
raise e
time.sleep(5)
self.setup_user()
self.start_ssh_session()
try:
self.start_ssh_session()
except pxssh.ExceptionPxssh as e:
self.close()
raise e
# make sure /tmp always exists
self.execute('mkdir -p /tmp')
# set git config