Skip to content

Commit

Permalink
Merge pull request #38757 from francescobrivio/fix_conddb
Browse files Browse the repository at this point in the history
Fix conddb dump functionality for tags and gts
  • Loading branch information
cmsbuild authored Jul 28, 2022
2 parents 62d132a + 948d599 commit 194fba8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions CondCore/Utilities/scripts/conddb
Original file line number Diff line number Diff line change
Expand Up @@ -2555,16 +2555,16 @@ def dump(args):
filter(IOV.tag_name == name).\
distinct():
if args.format == 'xml':
xmlProcessor.payload2xml(session, payload)
xmlProcessor.payload2xml(session, payload, args.destfile)
else:
_dump_payload(session, payload, args.loadonly)

elif args.type == 'gt' and _exists(session, conddb.GlobalTag.name, name) != None:
elif args.type == 'gt' and _exists(session, GlobalTag.name, name) != None:
for payload, in session.query(IOV.payload_hash).\
filter(GlobalTagMap.global_tag_name == name, IOV.tag_name == GlobalTagMap.tag_name).\
distinct():
if args.format == 'xml':
xmlProcessor.payload2xml(session, payload)
xmlProcessor.payload2xml(session, payload, args.destfile)
else:
_dump_payload(session, payload, args.loadonly)

Expand Down
7 changes: 6 additions & 1 deletion CondCore/Utilities/test/test_conddb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ conddb diffGlobalTagsAtRun -R 120X_mcRun3_2021_realistic_v1 -T 120X_mcRun3_2021_
echo -ne '\n\n'

echo "===========> testing conddb dump"
conddb dump 4b97f78682aac6254bbcba54cedbde468202bf5b || die 'failed comparing metadata with reference' $?
conddb dump 4b97f78682aac6254bbcba54cedbde468202bf5b || die 'failed conddb dump payload' $?
conddb dump 4b97f78682aac6254bbcba54cedbde468202bf5b --destfile payload_dump.xml || die 'failed conddb dump payload to file' $?
conddb dump SiPixelQuality_phase1_2021_v1 || die 'failed conddb dump tag' $?
conddb dump SiPixelQuality_phase1_2021_v1 --destfile tag_dump.xml || die 'failed conddb dump tag to file' $?
conddb dump Test_CMSSW_IB_unitTest_v1 || die 'failed conddb dump gt' $?
conddb dump Test_CMSSW_IB_unitTest_v1 --destfile gt_dump.xml || die 'failed conddb dump gt to file' $?
echo -ne '\n\n'

#conddb showFCSR || die 'failed conddb showFCSR' $? # the FCSR is not always a real run...

0 comments on commit 194fba8

Please sign in to comment.