Commit c01c0877 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

experiments: fix cleanup in local executor (rmtree)

rmtree was only deleting directories but not files and sockets.
parent 21657f48
......@@ -309,7 +309,10 @@ class LocalExecutor(Executor):
pathlib.Path(path).mkdir(parents=True, exist_ok=True)
async def rmtree(self, path, verbose=False):
shutil.rmtree(path, ignore_errors=True)
if os.path.isdir(path):
shutil.rmtree(path, ignore_errors=True)
elif os.path.exists(path):
os.unlink(path)
class RemoteExecutor(Executor):
def __init__(self, host_name, workdir):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment