Skip to content

Commit

Permalink
Implement davfs2 mounting
Browse files Browse the repository at this point in the history
  • Loading branch information
jwodder committed Jan 23, 2024
1 parent 48d7c8a commit 3fb16fa
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion code/src/healthstatus/mounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,16 @@ def type(self) -> MountType:

@contextmanager
def mount_webdav(self, url: str) -> Iterator[None]:
raise NotImplementedError
log.debug("Mounting davfs2 mount ...")
subprocess.run(

Check warning on line 209 in code/src/healthstatus/mounts.py

View check run for this annotation

Codecov / codecov/patch

code/src/healthstatus/mounts.py#L209

Added line #L209 was not covered by tests
["sudo", "mount", "-t", "davfs", url, os.fspath(self.mount_path)],
check=True,
)
try:
yield

Check warning on line 214 in code/src/healthstatus/mounts.py

View check run for this annotation

Codecov / codecov/patch

code/src/healthstatus/mounts.py#L213-L214

Added lines #L213 - L214 were not covered by tests
finally:
log.debug("Unmounting davfs2 mount ...")
subprocess.run(["sudo", "umount", os.fspath(self.mount_path)], check=True)

Check warning on line 217 in code/src/healthstatus/mounts.py

View check run for this annotation

Codecov / codecov/patch

code/src/healthstatus/mounts.py#L217

Added line #L217 was not covered by tests


def iter_mounters(
Expand Down

0 comments on commit 3fb16fa

Please sign in to comment.