From 32c193cd8bcb71a18c4533d35f47bbc6f0d47b29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 5 Mar 2015 21:02:45 +0100 Subject: [PATCH] Fix node IDs in subjobs. --- jobs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jobs.py b/jobs.py index ebd97fa..d6ebdce 100755 --- a/jobs.py +++ b/jobs.py @@ -376,6 +376,7 @@ for id, job in jobs.iteritems(): if regAtt.match(attempt['id']): attempt['id'] = regAtt.sub('', attempt['id']) nodeHost = regHost.sub('', attempt['nodeHttpAddress']) + attempt['nodeHttpAddress'] = nodeHost if nodeHost not in jobnodes: jobnodes[nodeHost] = JobNode() jobnodes[nodeHost].elapsed += attempt['elapsedTime'] @@ -410,6 +411,7 @@ for id, job in jobs.iteritems(): st.execute("DELETE FROM subjobs WHERE jobid=%s", id) for subjob in subjobs: + nodename = subjob['nodeHttpAddress'] st.execute('INSERT INTO subjobs (id, jobid, nodeid, state, type, start, finish) VALUES (%s, %s, %s, %s, %s, %s, %s)', (subjob['id'], id, node_hosts[nodename].id, subjob['state'], subjob['type'], subjob['startTime'], subjob['finishTime'])) if debug >= 2: print '[db] job %s subjobs updated' % id -- 1.8.2.3