2 Update the config-to-payload map table for the fast DAQ O2O. 7 from CondTools.SiStrip.o2o_db_manager
import make_dbtype, DbManager
14 __tablename__ =
'STRIP_CONFIG_TO_PAYLOAD_MAP' 15 config_hash = sqlalchemy.Column(sqlalchemy.String(2000), primary_key=
True)
16 payload_hash = sqlalchemy.Column(sqlalchemy.String(2000), nullable=
False)
17 payload_type = sqlalchemy.Column(sqlalchemy.String(2000), nullable=
False)
18 config_string = sqlalchemy.Column(sqlalchemy.String(2000), nullable=
False)
19 insertion_time = sqlalchemy.Column(sqlalchemy.TIMESTAMP, nullable=
False)
24 DbManager.__init__(self, db, authFile)
32 if not os.path.exists(input_path):
33 logging.info(
'No config-to-payload map file at %s. Skipping.' % input_path)
35 session = self.connect(
'sqlite:///%s' % input_path)
39 destSession = self.connect()
41 payload_hash=entry.payload_hash,
42 payload_type=entry.payload_type,
43 config_string=entry.config_string,
44 insertion_time=entry.insertion_time)
45 destSession.add(cfgmap)
47 logging.info(
'Updated config-to-payload map for %s' % cfgmap.payload_type)
48 logging.info(
'... config_hash = %s, payload_hash = %s' % (cfgmap.config_hash, cfgmap.payload_hash))
50 raise RuntimeError(
'No entry found in config-to-payload map file %s' % input_path)
def make_dbtype(backendName, schemaName, baseType)
def __init__(self, db, authFile=None)
def update_hashmap(self, input_path)