Skip to content

Commit

Permalink
fs: fix 3018 error code
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsherva committed Jan 24, 2024
1 parent 9cf4bb9 commit 0275865
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit 0275865

Please sign in to comment.