Skip to content

Commit edff3dd

Browse files
committed
Merge pull request cms-sw#1197 from argiro/condtools
DB updates -- adjust to new interface, remove obsolete externals (element tree).
2 parents 3cffb64 + 68dd433 commit edff3dd

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

CondTools/Ecal/python/EcalCondDB.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def usage():
2121
print "Specify short options as '-o foo', long options as '--option=foo'"
2222
print
2323
print " -c, --connect= [connectstring]"
24-
print " specify database, default oracle://cms_orcoff_prod/CMS_COND_31X_ECAL"
24+
print " specify database, default frontier://FrontierProd/CMS_COND_31X_ECAL"
2525
print
2626
print " -P, --authpath= [authenticationpath], default /afs/cern.ch/cms/DB/conddb "
2727
print
@@ -39,7 +39,7 @@ def usage():
3939
print " Example EcalCondDB.py -t tag"
4040
print
4141
print " -d, --dump= [file] dump record to xml file"
42-
print " Example EcalCondDB.py -d=file.xml -t tag -s since"
42+
print " Example EcalCondDB.py -d file.xml -t tag -s since"
4343
print
4444
print " -p, --plot= [file] plot record to file, extension specifies ",\
4545
"format (.root,.png,.jpg,.gif,.svg)"
@@ -73,7 +73,7 @@ def usage():
7373
print ex," , use -h or --help for help"
7474
sys.exit(0)
7575

76-
dbName = "oracle://cms_orcoff_prod/CMS_COND_31X_ECAL"
76+
dbName = "frontier://FrontierProd/CMS_COND_31X_ECAL"
7777
authpath= "/afs/cern.ch/cms/DB/conddb"
7878

7979
tags=[]
@@ -148,7 +148,7 @@ def usage():
148148
a = FWIncantation()
149149

150150
rdbms = RDBMS(authpath)
151-
db = rdbms.getDB(dbName)
151+
db = rdbms.getReadOnlyDB(dbName)
152152

153153
import EcalCondTools
154154

CondTools/Ecal/python/EcalCondTools.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
22
# Misc functions to manipulate Ecal records
33
# author: Stefano Argiro
4-
# id: $Id: EcalCondTools.py,v 1.12 2009/11/03 17:40:07 yma Exp $
4+
# id: $Id: EcalCondTools.py,v 1.14 2013/05/06 08:29:44 argiro Exp $
55
#
66
#
77
# WARNING: we assume that the list of iovs for a given tag
@@ -18,7 +18,7 @@
1818
def listTags(db):
1919
'''List all available tags for a given db '''
2020
try:
21-
db.startTransaction()
21+
db.startReadOnlyTransaction()
2222
tags = db.allTags()
2323
db.commitTransaction()
2424
for tag in tags.split():
@@ -43,7 +43,7 @@ def dumpXML(db,tag,since,filename='dump.xml'):
4343
'''Dump record in XML format for a given tag '''
4444
try :
4545
iov = inspect.Iov(db,tag)
46-
db.startTransaction()
46+
db.startReadOnlyTransaction()
4747
Plug = __import__(str(db.payloadModules(tag)[0]))
4848
payload = Plug.Object(db)
4949
listOfIovElem= [iovElem for iovElem in db.iov(tag).elements]
@@ -67,7 +67,7 @@ def plot (db, tag,since,filename='plot.root'):
6767

6868
try :
6969
iov = inspect.Iov(db,tag)
70-
db.startTransaction()
70+
db.startReadOnlyTransaction()
7171
Plug = __import__(str(db.payloadModules(tag)[0]))
7272
payload = Plug.Object(db)
7373
listOfIovElem= [iovElem for iovElem in db.iov(tag).elements]
@@ -100,7 +100,7 @@ def compare(tag1,db1,since1,
100100
if tag1.find(".xml") < 0:
101101
found=0
102102
try:
103-
db1.startTransaction()
103+
db1.startReadOnlyTransaction()
104104
Plug = __import__(str(db1.payloadModules(tag1)[0]))
105105
payload = Plug.Object(db1)
106106
listOfIovElem= [iovElem for iovElem in db1.iov(tag1).elements]
@@ -135,7 +135,7 @@ def compare(tag1,db1,since1,
135135
if tag2.find(".xml")<0:
136136
found=0
137137
try:
138-
db2.startTransaction()
138+
db2.startReadOnlyTransaction()
139139
Plug = __import__(str(db2.payloadModules(tag2)[0]))
140140
what = {'how':'barrel'}
141141
w = inspect.setWhat(Plug.What(),what)
@@ -242,7 +242,7 @@ def histo (db, tag,since,filename='histo.root'):
242242
found=0
243243
try:
244244
# exec('import '+db.moduleName(tag)+' as Plug')
245-
db.startTransaction()
245+
db.startReadOnlyTransaction()
246246
Plug = __import__(str(db.payloadModules(tag)[0]))
247247
payload = Plug.Object(db)
248248
listOfIovElem= [iovElem for iovElem in db.iov(tag).elements]

CondTools/Ecal/scripts/loadConditions.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import FWCore.ParameterSet.Config as cms
1111
import FWCore.ParameterSet.VarParsing as VarParsing
12-
from elementtree.ElementTree import parse
12+
from xml.etree.ElementTree import parse
1313
import sys,os
1414

1515

@@ -74,7 +74,7 @@ def readTagAndSince(filename, headertag='EcalCondHeader'):
7474
'EcalChannelStatus':'EcalChannelStatusAnalyzer', \
7575
'EcalTBWeights':'EcalTBWeightsAnalyzer', \
7676
'EcalIntercalibConstants':'EcalIntercalibConstantsAnalyzer', \
77-
'EcalIntercalibConstantsMC':'EcalIntercalibConstantsMCAnalyzer', \
77+
'EcalIntercalibConstantsMC':'EcalIntercalibConstantsMCAnalyzer', \
7878
'EcalIntercalibErrors':'EcalIntercalibErrorsAnalyzer'
7979
}
8080

0 commit comments

Comments
 (0)