Skip to content

Commit 9f0d2a3

Browse files
committed
fix: simplify loop with any call
1 parent 4bde07f commit 9f0d2a3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/DIRAC/DataManagementSystem/DB/FileCatalogComponents/SecurityManager/VOMSSecurityManager.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,7 @@ def __shareVomsRole(self, grpName, otherGrpName):
7979
def __isNotExistError(self, errorMsg):
8080
"""Returns true if the errorMsg means that the file/directory does not exist"""
8181

82-
for possibleMsg in ["not exist", "not found", "No such file or directory"]:
83-
if possibleMsg in errorMsg:
84-
return True
85-
86-
return False
82+
return any(possibleMsg in errorMsg for possibleMsg in ["not exist", "not found", "No such file or directory"])
8783

8884
def __getFilePermission(self, path, credDict, noExistStrategy=None):
8985
"""Checks POSIX permission for a file using the VOMS roles.

0 commit comments

Comments
 (0)