#!/bin/env python3 # # Script to get the "status" for the run from the RCDB condition and print it on stdout # # usage: ./get_coda_run_status.py [RCDB password] [run number] # example: ./get_coda_run_status.py dummy_password 30730 import os,sys import rcdb from rcdb.model import ConditionType, Condition, Run # entry point if __name__ == "__main__": try: db = rcdb.RCDBProvider("mysql://rcdb:%s@gluondb1/rcdb2"%sys.argv[1]) run = int(sys.argv[2]) returnedObject = db.get_condition(run, "status" ) # print ( "Return value is ", value ) if( returnedObject is None ) : print( "-1" ) else: print( returnedObject.value ) except Exception as e: print("Exception occurred:", type(e).__name__, e)