本文整理汇总了Python中fts3rest.lib.base.Session.execute方法的典型用法代码示例。如果您正苦于以下问题:Python Session.execute方法的具体用法?Python Session.execute怎么用?Python Session.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fts3rest.lib.base.Session
的用法示例。
在下文中一共展示了Session.execute方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: HTTPBadRequest
# 需要导入模块: from fts3rest.lib.base import Session [as 别名]
# 或者: from fts3rest.lib.base.Session import execute [as 别名]
raise HTTPBadRequest('Can not specify reuse and multiple replicas at the same time')
job['reuse_job'] = 'R'
# Update the optimizer
unique_pairs = set(map(lambda f: (f['source_se'], f['dest_se']), files))
for (source_se, dest_se) in unique_pairs:
optimizer_active = OptimizerActive()
optimizer_active.source_se = source_se
optimizer_active.dest_se = dest_se
optimizer_active.ema = 0
optimizer_active.datetime = datetime.utcnow()
Session.merge(optimizer_active)
# Update the database
try:
Session.execute(Job.__table__.insert(), [job])
if len(files):
Session.execute(File.__table__.insert(), files)
if len(datamanagement):
Session.execute(DataManagement.__table__.insert(), datamanagement)
Session.commit()
except:
Session.rollback()
raise
if len(files):
log.info("Job %s submitted with %d transfers" % (job['job_id'], len(files)))
else:
log.info("Job %s submitted with %d data management operations" % (job['job_id'], len(datamanagement)))
return {'job_id': job['job_id']}