-
Notifications
You must be signed in to change notification settings - Fork 2
/
report_artifacts.py
41 lines (29 loc) · 1.16 KB
/
report_artifacts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'''
Copyright 2022 Flexera Software LLC
See LICENSE.TXT for full license text
SPDX-License-Identifier: MIT
Author : sgeary
Created On : Thu Mar 10 2022
File : report_artifacts.py
'''
import logging
import report_artifacts_xml
import report_artifacts_json
logger = logging.getLogger(__name__)
#--------------------------------------------------------------------------------#
def create_report_artifacts(reportData, reportOptions):
logger.info("Entering create_report_artifacts")
# Dict to hold the complete list of reports
reports = {}
jsonFile = report_artifacts_json.generate_json_report(reportData)
xmlFile = report_artifacts_xml.generate_cyclonedx_report(reportData)
reports["viewable"] = jsonFile
reports["allFormats"] = [jsonFile, xmlFile]
if reportOptions["includeVDRReport"]:
vdrFile = report_artifacts_xml.generate_vdr_report(reportData)
reports["allFormats"].append(vdrFile)
if reportOptions["includeVEXReport"]:
vexFile = report_artifacts_xml.generate_vex_report(reportData)
reports["allFormats"].append(vexFile)
logger.info("Exiting create_report_artifacts")
return reports