Skip to content

Commit 907c023

Browse files
authored
Merge pull request #8003 from DIRACGridBot/cherry-pick-2-02ef9e096-integration
[sweep:integration] fix: exit with status 1 in case of error
2 parents 97d11c1 + 7c188c9 commit 907c023

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/DIRAC/DataManagementSystem/scripts/dirac_dms_user_lfns.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
/formation/user/v/vhamar/0/20: 1 files, 0 sub-directories
1616
16 matched files have been put in formation-user-v-vhamar.lfns
1717
"""
18+
19+
import fnmatch
20+
from datetime import datetime, timedelta
21+
1822
from DIRAC.Core.Base.Script import Script
1923

2024

@@ -54,11 +58,6 @@ def main():
5458
from DIRAC.ConfigurationSystem.Client.Helpers.Registry import getVOForGroup
5559
from DIRAC.Core.Security.ProxyInfo import getProxyInfo
5660
from DIRAC.Resources.Catalog.FileCatalog import FileCatalog
57-
from datetime import datetime, timedelta
58-
import sys
59-
import os
60-
import time
61-
import fnmatch
6261

6362
fc = FileCatalog()
6463

@@ -108,8 +107,10 @@ def isOlderThan(cTimeStruct, days):
108107
res = fc.getDirectoryDump(baseDir, timeout=360)
109108
if not res["OK"]:
110109
gLogger.error("Error retrieving directory contents", f"{baseDir} {res['Message']}")
110+
DIRAC.exit(1)
111111
elif baseDir in res["Value"]["Failed"]:
112112
gLogger.error("Error retrieving directory contents", f"{baseDir} {res['Value']['Failed'][baseDir]}")
113+
DIRAC.exit(1)
113114
else:
114115
dirContents = res["Value"]["Successful"][baseDir]
115116
subdirs = dirContents["SubDirs"]

0 commit comments

Comments
 (0)