@@ -79,10 +79,12 @@ def build_artifact(self, data_type, data, **kwargs):
7979 (dst , filename ) = tempfile .mkstemp (dir = os .path .join (self .job_directory , "output" ))
8080 with open (data , 'r' ) as src :
8181 copyfileobj (src , os .fdopen (dst , 'w' ))
82- return {** kwargs , 'dataType' : data_type , 'file' : ntpath .basename (filename ),
83- 'filename' : ntpath .basename (data )}
82+ kwargs .update ({'dataType' : data_type , 'file' : ntpath .basename (filename ),
83+ 'filename' : ntpath .basename (data )})
84+ return kwargs
8485 else :
85- return {** kwargs , 'dataType' : data_type , 'data' : data }
86+ kwargs .update ({'dataType' : data_type , 'data' : data })
87+ return kwargs
8688
8789 def report (self , full_report , ensure_ascii = False ):
8890 """Returns a json dict via stdout.
@@ -96,15 +98,12 @@ def report(self, full_report, ensure_ascii=False):
9698 except Exception :
9799 pass
98100
99- report = {
101+ super ( Analyzer , self ). report ( {
100102 'success' : True ,
101103 'summary' : summary ,
102104 'artifacts' : self .artifacts (full_report ),
103105 'full' : full_report
104- }
105- os .makedirs ('%s/output' % self .job_directory , exist_ok = True )
106- with open ('%s/output/output.json' % self .job_directory , mode = 'w' ) as f_output :
107- json .dump (report , f_output , ensure_ascii = ensure_ascii )
106+ }, ensure_ascii )
108107
109108 def run (self ):
110109 """Overwritten by analyzers"""
0 commit comments