Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0] fix: exit with status 1 in case of error #8001

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/DIRAC/DataManagementSystem/scripts/dirac_dms_user_lfns.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
/formation/user/v/vhamar/0/20: 1 files, 0 sub-directories
16 matched files have been put in formation-user-v-vhamar.lfns
"""

import fnmatch
from datetime import datetime, timedelta

from DIRAC.Core.Base.Script import Script


Expand Down Expand Up @@ -54,11 +58,6 @@ def main():
from DIRAC.ConfigurationSystem.Client.Helpers.Registry import getVOForGroup
from DIRAC.Core.Security.ProxyInfo import getProxyInfo
from DIRAC.Resources.Catalog.FileCatalog import FileCatalog
from datetime import datetime, timedelta
import sys
import os
import time
import fnmatch

fc = FileCatalog()

Expand Down Expand Up @@ -108,8 +107,10 @@ def isOlderThan(cTimeStruct, days):
res = fc.getDirectoryDump(baseDir, timeout=360)
if not res["OK"]:
gLogger.error("Error retrieving directory contents", f"{baseDir} {res['Message']}")
DIRAC.exit(1)
elif baseDir in res["Value"]["Failed"]:
gLogger.error("Error retrieving directory contents", f"{baseDir} {res['Value']['Failed'][baseDir]}")
DIRAC.exit(1)
else:
dirContents = res["Value"]["Successful"][baseDir]
subdirs = dirContents["SubDirs"]
Expand Down
Loading