Commit 32441b27 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

experiments: introduce mkdir and rmtree in executor

parent 0fe2c879
......@@ -23,6 +23,8 @@
import asyncio
import shlex
import os
import pathlib
import shutil
import signal
class HostConfig(object):
......@@ -205,6 +207,12 @@ class Executor(object):
async def send_file(self, path, verbose=False):
raise NotImplementedError("Please Implement this method")
async def mkdir(self, path, verbose=False):
raise NotImplementedError("Please Implement this method")
async def rmtree(self, path, verbose=False):
raise NotImplementedError("Please Implement this method")
# runs the list of commands as strings sequentially
async def run_cmdlist(self, label, cmds, verbose=True, host=None):
i = 0
......@@ -226,4 +234,10 @@ class LocalExecutor(Executor):
async def send_file(self, path, verbose):
# locally we do not need to do anything
pass
\ No newline at end of file
pass
async def mkdir(self, path, verbose=False):
pathlib.Path(path).mkdir(parents=True, exist_ok=True)
async def rmtree(self, path, verbose=False):
shutil.rmtree(path, ignore_errors=True)
\ No newline at end of file
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