Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: fix 3018 error code #125

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions xrootdpyfs/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def _p(self, path, encoding="utf-8"):
def _raise_status(self, path, status):
"""Raise error based on status."""
# 3006 - legacy (v4 errno), 17 - POSIX error, 3018 (xrootd v5 errno)
if status.errno in [3006, 17, 3018]:
if status.errno in [3006, 17]:
raise DestinationExists(path=path, msg=status)
elif status.errno == 3005:
# Unfortunately only way to determine if the error is due to a
Expand All @@ -159,6 +159,8 @@ def _raise_status(self, path, status):
raise DirectoryNotEmpty(path=path, msg=status)
elif status.errno == 3011:
raise ResourceNotFound(path=path, msg=status)
elif status.errno == 3018:
raise DirectoryNotEmpty(path=path, msg=status)
else:
raise ResourceError(path=path, msg=status)

Expand Down Expand Up @@ -353,7 +355,7 @@ def makedir(

if not status.ok:
# 3018 introduced in xrootd5, 17 = POSIX error, 3006 - legacy errno
destination_exists = status.errno in [3006, 3018, 17]
destination_exists = status.errno in [3006, 17]
if allow_recreate and destination_exists:
return True
self._raise_status(path, status)
Expand Down
Loading