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

Fix conddb dump functionality for tags and gts #38757

Merged
merged 2 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
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
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...