Skip to content

Commit

Permalink
Update path.py (#124)
Browse files Browse the repository at this point in the history
firecrest does not support `exist_ok`, it's somehow blended into `parents`
  • Loading branch information
khsrali authored Oct 21, 2024
1 parent bb45370 commit 6fc19ce
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions firecrest/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,16 +533,11 @@ def mkdir(
"""Create a new directory at this given path."""
if mode is not None:
raise NotImplementedError("mode is not supported yet")
try:
with self.convert_header_exceptions(
{
"X-Invalid-Path": FileExistsError # Note see: https://github.com/eth-cscs/firecrest/issues/172
}
):
self._client.mkdir(self._machine, self.path, p=parents)
except FileExistsError:
if not exist_ok:
raise
with self.convert_header_exceptions():
# Note see: https://github.com/eth-cscs/firecrest/issues/172
# Also see: https://github.com/eth-cscs/firecrest/issues/202
# firecrest does not support `exist_ok`, it's somehow blended into `parents`
self._client.mkdir(self._machine, self.path, p=parents if not exist_ok else True)

def touch(self, mode: None = None, exist_ok: bool = True) -> None:
"""Create a file at this given path.
Expand Down

0 comments on commit 6fc19ce

Please sign in to comment.