From 54baed89290b73c99efdfeaad86211c3d3e62488 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Fri, 19 Jan 2024 13:49:16 -0500 Subject: [PATCH] More logging --- code/src/healthstatus/mounts.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/src/healthstatus/mounts.py b/code/src/healthstatus/mounts.py index 5db83d642..edc500ede 100644 --- a/code/src/healthstatus/mounts.py +++ b/code/src/healthstatus/mounts.py @@ -49,6 +49,7 @@ def fused( if logdir is None: logdir = Path() with (logdir / "fuse.log").open("wb") as fp: + log.debug("Starting `datalad fusefs` process ...") with subprocess.Popen( [ "datalad", @@ -66,6 +67,7 @@ def fused( try: yield finally: + log.debug("Terminating `datalad fusefs` process ...") p.send_signal(SIGINT) @@ -74,6 +76,7 @@ def dandidav(logdir: Path | None = None) -> Iterator[str]: if logdir is None: logdir = Path() with (logdir / "dandidav.log").open("wb") as fp: + log.debug("Starting `dandidav` process ...") with subprocess.Popen(["dandidav"], stdout=fp, stderr=fp) as p: try: url = "http://127.0.0.1:8080" @@ -88,11 +91,13 @@ def dandidav(logdir: Path | None = None) -> Iterator[str]: raise RuntimeError("WebDAV server did not start up time") yield url finally: + log.debug("Terminating `dandidav` process ...") p.send_signal(SIGINT) @contextmanager def webdavfs(url: str, mount_path: str | os.PathLike[str]) -> Iterator[None]: + log.debug("Mounting webdavfs mount ...") subprocess.run( ["sudo", "mount", "-t", "webdavfs", url, os.fspath(mount_path)], check=True, @@ -100,6 +105,7 @@ def webdavfs(url: str, mount_path: str | os.PathLike[str]) -> Iterator[None]: try: yield finally: + log.debug("Unmounting webdavfs mount ...") subprocess.run(["sudo", "umount", os.fspath(mount_path)], check=True)