This commit is contained in:
Marc Beninca 2023-07-17 23:07:42 +02:00
parent cb48fd3e62
commit deb709d488

View file

@ -6,7 +6,7 @@ CHARSET = 'UTF-8'
def create_image(file_path: str, size_bytes: int): def create_image(file_path: str, size_bytes: int):
subprocess.call([ subprocess.run([
'qemu-img', 'qemu-img',
'create', 'create',
'-f', 'qcow2', '-f', 'qcow2',
@ -28,6 +28,8 @@ def wipe(path: str):
shutil.rmtree(path) shutil.rmtree(path)
except NotADirectoryError: except NotADirectoryError:
os.remove(path) os.remove(path)
except FileNotFoundError:
pass
def write(file_path: str, text: str, charset=CHARSET): def write(file_path: str, text: str, charset=CHARSET):