Commit e50ca427 authored by Azat Khuziyakhmetov's avatar Azat Khuziyakhmetov
Browse files

bug fix

parent 2fbfb780
......@@ -249,10 +249,10 @@ def format_influxdb_alloc(job_id, alloc_info, cur_time):
for node_name, alloc_cu in alloc_info.items():
req += "{:s},jobid={:s} ".format(mname, job_id)
req += "node_name={},".format(node_name)
req += "node_name=\"{}\",".format(node_name)
req += "alloc_cu={}".format(alloc_cu)
req += " {:d};".format(cur_time)
req += " {:d}\n".format(cur_time)
return req
......@@ -264,7 +264,7 @@ def format_influx_db_out(job_id, job_data, alloc_data):
req += ",".join(format_fields(k, v, _info) for k, v in job_data.items())
req += " {:d};".format(cur_time)
req += " {:d}\n".format(cur_time)
alloc_influx = format_influxdb_alloc(job_id, alloc_data, cur_time)
......@@ -318,7 +318,6 @@ def export_job_info(job_id):
job_info, alloc_info = fetch_job_data(job_id)
fdata = format_influx_db_out(job_id, job_info, alloc_info)
payload = {'db': confdb.IDB["database"], 'precision': 's'}
write_url = "{:s}/write".format(confdb.IDB["api_url"])
......@@ -327,6 +326,6 @@ def export_job_info(job_id):
params=payload, data=fdata)
if r.status_code != 204:
return r.status_code
raise ValueError("Couldn't write to InfluxDB", r.status_code, r.content)
return True
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