Skip to content

Commit

Permalink
sweep: DIRACGrid#7778 fix: return correct error for non-existing dire…
Browse files Browse the repository at this point in the history
…ctory
  • Loading branch information
marianne013 authored and web-flow committed Sep 11, 2024
1 parent b627e05 commit 3fa36ce
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ def getPathIDs(self, path):
pelements = []
dPath = ""
for el in elements[1:]:
# skip entry path elements, e.g. path has trailing slash
if not el:
continue
dPath += "/" + el
pelements.append(dPath)
pelements.append("/")
Expand All @@ -283,6 +286,8 @@ def getPathIDs(self, path):
result = self.db._query(req)
if not result["OK"]:
return result
if len(result["Value"]) != len(pelements):
return S_ERROR(f"Directory {path} not found")
if not result["Value"]:
return S_ERROR(f"Directory {path} not found")

Expand Down

0 comments on commit 3fa36ce

Please sign in to comment.