Skip to content

Commit

Permalink
Merge pull request DIRACGrid#7780 from DIRACGridBot/cherry-pick-2-cc2…
Browse files Browse the repository at this point in the history
…c6e502-integration

[sweep:integration] fix: return correct error for non-existing directory
  • Loading branch information
fstagni authored Sep 11, 2024
2 parents 6a28b8e + 3fa36ce commit a40662a
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 a40662a

Please sign in to comment.