lint/fs
This commit is contained in:
parent
e306971534
commit
63d30013a3
1 changed files with 8 additions and 3 deletions
|
@ -1,3 +1,5 @@
|
|||
"""Operations involving FileSystems."""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
||||
|
@ -6,7 +8,8 @@ from rwx import ps
|
|||
CHARSET = "UTF-8"
|
||||
|
||||
|
||||
def create_image(file_path: str, size_bytes: int):
|
||||
def create_image(file_path: str, size_bytes: int) -> None:
|
||||
"""Create a virtual device image file."""
|
||||
ps.run(
|
||||
("qemu-img", "create"),
|
||||
("-f", "qcow2"),
|
||||
|
@ -14,11 +17,13 @@ def create_image(file_path: str, size_bytes: int):
|
|||
)
|
||||
|
||||
|
||||
def empty_file(path: str):
|
||||
def empty_file(path: str) -> None:
|
||||
"""Empty the file at provided path."""
|
||||
write(path, "")
|
||||
|
||||
|
||||
def get_mount_uuid(path: str):
|
||||
def get_mount_uuid(path: str) -> str:
|
||||
"""Return the UUID of provided mountpoint path."""
|
||||
return ps.run_line(
|
||||
("findmnt",),
|
||||
("--noheadings",),
|
||||
|
|
Loading…
Reference in a new issue