Improve FS discovery logging

This commit is contained in:
Darryl Nixon 2023-07-16 11:01:38 -07:00
parent 587905ed9a
commit ef7b1b95f6

View file

@ -30,6 +30,7 @@ def get_all_mounts() -> List:
async def mount_to_fs_handler(path: Path) -> str:
# TODO: This is a hacky way to get the filesystem type, but it works for now.
# Maybe with libblkid Python bindings?
logger.info(f"Getting filesystem for mount: {path}")
proc = await asyncio.create_subprocess_exec(
"stat", "-f", "-L", "-c", "%T", str(path), stdout=asyncio.subprocess.PIPE, stdin=asyncio.subprocess.PIPE
)
@ -41,6 +42,7 @@ async def mount_to_fs_handler(path: Path) -> str:
raise RuntimeError(err)
fs = stdout.decode().strip()
logger.info(f"Filesystem for {path}: {fs}")
try:
return FSHandlers[fs]