Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions alts/worker/runners/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1750,13 +1750,12 @@ def setup(self, skip_provision: bool = False):
self._ssh_client = LongRunSSHClient(**params)

def teardown(self, publish_artifacts: bool = True):
if not self._vm_alive:
if self._ssh_client:
try:
self._ssh_client.close()
except:
pass
super().teardown(publish_artifacts=publish_artifacts)
if self._ssh_client:
try:
self._ssh_client.close()
except:
pass
super().teardown(publish_artifacts=publish_artifacts)

def exec_command(self, *args, **kwargs) -> Tuple[int, str, str]:
command = ' '.join(args)
Expand Down
2 changes: 2 additions & 0 deletions alts/worker/runners/opennebula.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ def recover_delete():
recover_delete()

def _stop_env(self):
if self._vm_alive:
return 0, "WARNING: VM won't be destroyed because vm_alive=True was given", ""
stop_exit_code, stop_out, stop_err = super()._stop_env()
if stop_exit_code == 0:
return stop_exit_code, stop_out, stop_err
Expand Down
Loading