Skip to content

Commit 432fd81

Browse files
author
Ed Costello
committed
DOCS335 checkpoint
1 parent 7cebc2c commit 432fd81

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

bin/errorcodes.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[errorcodes]
33
source = /Users/epc/Documents/github/mongo
44
outputDir = /Users/epc/Documents/github/epc/docs/draft/reference/error
5-
generateCSV = no
5+
generateCSV = yes
66
# errorsFormat = separate | single
77
Format = separate
88
Title = "MongoDB Error and Message Codes"

bin/errorcodes.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ def genErrorOutput():
264264

265265
def genErrorOutputCSV():
266266
"""Parse through codes array and generate a csv file."""
267+
errorsCSV = "{}/errors.csv".format(resultsRoot)
267268
sys.stderr.write("Writing to {}\n".format(errorsCSV))
268269
if os.path.exists(errorsCSV):
269270
i=open(errorsCSV,"r");
@@ -274,7 +275,7 @@ def genErrorOutputCSV():
274275
prev = ""
275276
seen = {}
276277

277-
stripChars = " " + "\n"
278+
stripChars = " " + "\n" + '"'
278279

279280

280281
codes.sort( key=lambda x: x[0]+"-"+x[3] )
@@ -287,7 +288,7 @@ def genErrorOutputCSV():
287288
f=f[2:]
288289
fn = f.rpartition("/")[2]
289290

290-
out.write('"{}","{}","{}","{}","{}","{}"'.format(num, getBestMessage(line , str(num)).strip(stripChars),f,l,message,severity))
291+
out.write('"{}","{}","{}","{}","{}","{}"'.format(num, getBestMessage(line , str(num)).strip(stripChars),f,l,message.strip(stripChars),severity))
291292

292293
out.write("\n")
293294

@@ -303,5 +304,5 @@ def genErrorOutputCSV():
303304
outputFile = "{}/errorcodes.json".format(resultsRoot)
304305
out = open(outputFile, 'wb')
305306
sys.stderr.write("Generating JSON file: {}\n".format(outputFile))
306-
out.write(json.dumps(messages))
307-
out.close()
307+
out.write(json.dumps(messages))
308+
out.close()

0 commit comments

Comments
 (0)