File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1616EXAMPLE_OSS_PKG_INFO_LINK = "https://github.com/fosslight/fosslight_prechecker/blob/main/tests/convert/sbom-info.yaml"
1717
1818
19- def parsing_yml (yaml_file , base_path ):
19+ def parsing_yml (yaml_file , base_path , print_log = True ):
2020 oss_list = []
2121 license_list = []
2222 idx = 1
@@ -51,9 +51,13 @@ def parsing_yml(yaml_file, base_path):
5151 license_list .extend (item .license )
5252 idx += 1
5353 except AttributeError as ex :
54- _logger .error (f"Not supported yaml file format { ex } " )
54+ if print_log :
55+ _logger .error (f"Not supported yaml file format { ex } " )
56+ oss_list = []
5557 except yaml .YAMLError :
56- _logger .warning (f"Can't parse yaml - skip to parse yaml file: { yaml_file } " )
58+ if print_log :
59+ _logger .warning (f"Can't parse yaml - skip to parse yaml file: { yaml_file } " )
60+ oss_list = []
5761 return oss_list , set (license_list )
5862
5963
You can’t perform that action at this time.
0 commit comments