Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
csst
Scalebox Apps
Commits
e252351d
Commit
e252351d
authored
Feb 24, 2023
by
zxl
Browse files
Get JOBID through environment variable
parent
92ceb371
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
6 deletions
+2
-6
L1/dockerfiles/admL1/mgL1.py
L1/dockerfiles/admL1/mgL1.py
+2
-6
No files found.
L1/dockerfiles/admL1/mgL1.py
View file @
e252351d
...
@@ -35,12 +35,8 @@ class admL1Api():
...
@@ -35,12 +35,8 @@ 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
current_job_id
=
os
.
getenv
(
'JOB_ID'
)
admsql
=
"SELECT id FROM t_job where name = 'admL1'"
cursor
.
execute
(
admsql
)
admrows
=
cursor
.
fetchone
()
current_job_id
=
admrows
[
0
]
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment