mirror of https://github.com/databricks/cli.git
lint
This commit is contained in:
parent
8213c4fa22
commit
0e300c6a40
|
@ -5,11 +5,12 @@ import time
|
|||
import platform
|
||||
import subprocess
|
||||
|
||||
|
||||
def is_finished_windows(pid):
|
||||
assert int(pid) > 0
|
||||
|
||||
# Run task list but filter the list by pid..
|
||||
output = subprocess.check_output(f"tasklist /fi \"PID eq {pid}\"", text=True)
|
||||
output = subprocess.check_output(f'tasklist /fi "PID eq {pid}"', text=True)
|
||||
|
||||
# If tasklist does not find any process, that means the process we are
|
||||
# waiting for has terminated.
|
||||
|
@ -19,6 +20,7 @@ def is_finished_windows(pid):
|
|||
|
||||
return False
|
||||
|
||||
|
||||
def is_finished_unix(pid):
|
||||
assert int(pid) > 0
|
||||
|
||||
|
@ -54,9 +56,9 @@ def wait_pid(pid):
|
|||
|
||||
time.sleep(sleep_time)
|
||||
|
||||
|
||||
print(f"Timeout: Process {pid} did not end within 1 minute")
|
||||
return 1
|
||||
|
||||
|
||||
exit_code = wait_pid(int(sys.argv[1]))
|
||||
sys.exit(exit_code)
|
||||
|
|
Loading…
Reference in New Issue