Skip to content

Commit d0fa575

Browse files
committed
contest: collector: fix recording JSON device_info
Signed-off-by: Jakub Kicinski <[email protected]>
1 parent f634ab2 commit d0fa575

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

contest/results-collector.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,18 @@ def psql_insert_device(self, data):
235235
info = rows[0][0]
236236
else:
237237
info = 'x'
238-
if info == data['device']:
238+
239+
new_info = data["device"]
240+
if isinstance(new_info, dict):
241+
new_info = json.dumps(new_info)
242+
if info == new_info:
239243
return
240244

241245
with self.psql_conn.cursor() as cur:
242246
cur.execute(f"INSERT INTO devices_info (remote, executor, changed, info) " +
243247
cur.mogrify("VALUES(%s, %s, %s, %s)",
244248
(data["remote"], data["executor"],
245-
data["start"], data["device"])).decode('utf-8'))
249+
data["start"], new_info)).decode('utf-8'))
246250

247251
def insert_real(self, remote, run):
248252
data = run.copy()

0 commit comments

Comments
 (0)