Skip to content
Snippets Groups Projects

Deployed version as on 31.08.2020 on xcal

Merged Karim Ahmed requested to merge xcal_deployed into master
3 unresolved threads
2 files
+ 17
5
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 16
4
import argparse
import sqlite3
file_path = "/home/xcal/calibration_webservice/webservice/webservice_jobs.sqlite"
run = '247'
proposal = '900138'
parser = argparse.ArgumentParser(
description='Update run status at MDC for a given run id.')
parser.add_argument('--sqlite-fpath', type=str, help='Path to sqlite file path',
default='/home/xcal/calibration_webservice/webservice/webservice_jobs.sqlite') # noqa
parser.add_argument('--run', type=str, help='The run number required '
' for checking its job status.')
parser.add_argument('--proposal', type=str, help='Proposal numer')
args = vars(parser.parse_args())
sqlite_fpath = args['sqlite_fpath']
proposal = args['proposal'].zfill(6)
run = args['run']
conn = sqlite3.connect(file_path)
conn = sqlite3.connect(sqlite_fpath)
c = conn.cursor()
c.execute("SELECT * FROM jobs")
@@ -15,3 +26,4 @@ for r in c.fetchall():
rid, jobid, db_proposal, db_run, status, time, _, _ = r
if db_proposal == proposal and db_run == run:
print(r)
Loading