Commit e252351d authored by zxl's avatar zxl
Browse files

Get JOBID through environment variable

parent 92ceb371
...@@ -35,13 +35,9 @@ class admL1Api(): ...@@ -35,13 +35,9 @@ class admL1Api():
# conn = psycopg2.connect(host="10.255.2.12",port=5433,user="scalebox",password="changeme",database="scalebox") # conn = psycopg2.connect(host="10.255.2.12",port=5433,user="scalebox",password="changeme",database="scalebox")
conn = psycopg2.connect(host=shost,port=sport,user=suser,password=spwd,database=sdb) conn = psycopg2.connect(host=shost,port=sport,user=suser,password=spwd,database=sdb)
cursor = conn.cursor() cursor = conn.cursor()
#sql ="SELECT id,name FROM t_app ;"
#根据admL1的名字查找它的jobid
admsql = "SELECT id FROM t_job where name = 'admL1'"
cursor.execute(admsql)
admrows = cursor.fetchone()
current_job_id = admrows[0]
current_job_id=os.getenv('JOB_ID')
sql ="SELECT job_name FROM t_obs where obs_x ='{}' ;".format(obsid) sql ="SELECT job_name FROM t_obs where obs_x ='{}' ;".format(obsid)
cursor.execute(sql) cursor.execute(sql)
rows = cursor.fetchall() rows = cursor.fetchall()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment