(2.9) Make gnt-debug locks display fake job locks properly
authorHrvoje Ribicic <riba@google.com>
Tue, 25 Feb 2014 16:28:59 +0000 (16:28 +0000)
committerDimitris Aragiorgis <dimara@grnet.gr>
Thu, 27 Mar 2014 08:01:10 +0000 (10:01 +0200)
When a job is dependent on other jobs, a fake lock is created whose
pending entry contains a list of job ids waiting on the job. gnt-debug
locks did not expect the job ids to be ints, crashing when encountering
them. This patch fixes the situation by forcing a string cast.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Jose A. Lopes <jabolopes@google.com>

lib/client/gnt_debug.py

index 829ed05..35580e0 100644 (file)
@@ -595,7 +595,7 @@ def ListLocks(opts, args): # pylint: disable=W0613
     """Format pending acquires.
 
     """
-    return utils.CommaJoin("%s:%s" % (mode, ",".join(threads))
+    return utils.CommaJoin("%s:%s" % (mode, ",".join(map(str, threads)))
                            for mode, threads in value)
 
   # Format raw values