99import tempfile
1010import StringIO
1111
12+ from collections import deque
1213from django .conf import settings
1314
1415import debug # pyflakes:ignore
1819from ietf .utils .pipe import pipe
1920from ietf .utils .test_runner import set_coverage_checking
2021
22+ cmd_pipe_results = deque ([], 4 )
23+
2124class DraftSubmissionChecker ():
2225 name = ""
2326
@@ -71,6 +74,8 @@ def check_file_txt(self, path):
7174 Error and warning list items are tuples:
7275 (line_number, line_text, message)
7376 """
77+ global cmd_pipe_results
78+
7479 items = []
7580 errors = 0
7681 warnings = 0
@@ -80,6 +85,7 @@ def check_file_txt(self, path):
8085
8186 cmd = "%s %s %s" % (settings .IDSUBMIT_IDNITS_BINARY , self .options , path )
8287 code , out , err = pipe (cmd )
88+ cmd_pipe_results .append ((code , out , err ))
8389 if code != 0 or out == "" :
8490 message = "idnits error: %s:\n Error %s: %s" % ( cmd , code , err )
8591 log (message )
@@ -204,6 +210,7 @@ def check_file_txt(self, path):
204210 cmd_version = VersionInfo .objects .get (command = command ).version
205211 cmd = cmd_template .format (libs = modpath , model = path )
206212 code , out , err = pipe (cmd )
213+ cmd_pipe_results .append ((code , out , err ))
207214 if code > 0 or len (err .strip ()) > 0 :
208215 error_lines = err .splitlines ()
209216 assertion ('len(error_lines) > 0' )
@@ -235,6 +242,7 @@ def check_file_txt(self, path):
235242 cmd = cmd_template .format (model = path , rfclib = settings .SUBMIT_YANG_RFC_MODEL_DIR , tmplib = workdir ,
236243 draftlib = settings .SUBMIT_YANG_DRAFT_MODEL_DIR , ianalib = settings .SUBMIT_YANG_IANA_MODEL_DIR , )
237244 code , out , err = pipe (cmd )
245+ cmd_pipe_results .append ((code , out , err ))
238246 if code > 0 or len (err .strip ()) > 0 :
239247 error_lines = err .splitlines ()
240248 for line in error_lines :
0 commit comments