[Autoscaler] Fix k8s command runner when command fails (#10966)

Co-authored-by: Allen Yin <allenyin@anyscale.io>
This commit is contained in:
Allen
2020-09-23 13:25:49 -07:00
committed by GitHub
co-authored by Allen Yin
parent 7931b6ce2e
commit 567009d5fd
3 changed files with 19 additions and 4 deletions
+3 -1
View File
@@ -1,5 +1,6 @@
import os
import shutil
from subprocess import CalledProcessError
import tempfile
import threading
import time
@@ -48,7 +49,8 @@ class MockProcessRunner:
def check_call(self, cmd, *args, **kwargs):
for token in self.fail_cmds:
if token in str(cmd):
raise Exception("Failing command on purpose")
raise CalledProcessError(1, token,
"Failing command on purpose")
self.calls.append(cmd)
def check_output(self, cmd):