7 from PyCool
import cool
8 sys.path.append(
'/afs/cern.ch/user/a/atlcond/utils22')
9 from CondUtilsLib.AtlCoolBKLib
import resolveAlias
16 resolver=resolveAlias()
18 currentGlobal=resolver.getCurrentES().
replace(
"*",
"ST")
19 nextGlobal=resolver.getNextES().
replace(
"*",
"ST")
21 currentGlobal=resolver.getCurrent().
replace(
"*",
"ST")
22 nextGlobal=resolver.getNext().
replace(
"*",
"ST")
24 print(
'currentGlobal: ',currentGlobal)
26 dbSvc = cool.DatabaseSvcFactory.databaseService()
27 db = dbSvc.openDatabase(dbname)
28 f=db.getFolder(folderName)
30 current=f.resolveTag(currentGlobal)
32 print(
'Warning: could not resolve ',currentGlobal,
' in db: ',dbname)
34 print(
'resolving for the global CONDBR2-BLKPA-2022-10')
35 tmpGlobal=
'CONDBR2-BLKPA-2022-10'
37 print(
'resolving for the global COMCOND-BLKPA-RUN1-06')
38 tmpGlobal=
'COMCOND-BLKPA-RUN1-06'
41 current=f.resolveTag(tmpGlobal)
43 print(
'Also not working, giving up')
50 next=f.resolveTag(nextGlobal)
59 if __name__==
"__main__":
61 sys.stderr.write(
"Usage: %s dbname folder\n" % sys.argv[0].
split(
"/")[-1])
74 sys.stderr.write(
"Failed to resolve current folder-level tag for folder %s in db %s\n" % (fn,dn))