diff options
author | James Wahlin <james@mongodb.com> | 2018-04-18 10:26:33 -0400 |
---|---|---|
committer | James Wahlin <james@mongodb.com> | 2018-04-18 13:03:56 -0400 |
commit | 27932e642e7ee583418c982172b0f0465ac348bd (patch) | |
tree | 2927465033866d5156f6f0495cc105781e63f56b /buildscripts/gdb | |
parent | adcbe28e5c66d0e6fc108073cf15f3fc4e078b4d (diff) | |
download | mongo-27932e642e7ee583418c982172b0f0465ac348bd.tar.gz |
SERVER-34519 mongo_lock.py generating malformed graphviz output
Diffstat (limited to 'buildscripts/gdb')
-rw-r--r-- | buildscripts/gdb/mongo_lock.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/buildscripts/gdb/mongo_lock.py b/buildscripts/gdb/mongo_lock.py index ecd1cf743aa..62ba46f8194 100644 --- a/buildscripts/gdb/mongo_lock.py +++ b/buildscripts/gdb/mongo_lock.py @@ -185,8 +185,12 @@ class Graph(object): color = "" if nodes and node_key in nodes: color = "color = red" - sb.append(' "{}" [label="{}" {}]'.format(node_key, self.nodes[node_key]['node'], - color)) + + # The DOT language requires that literal double quotes be escaped using a backslash + # character. + escaped_label = str(self.nodes[node_key]['node']).replace('"', '\\"') + + sb.append(' "{}" [label="{}" {}]'.format(node_key, escaped_label, color)) sb.append("}") return "\n".join(sb) |