Skip to content

Commit b2d7ca4

Browse files
committed
Revert "chg: [stix2 export] Trying to find the origin of an issue happening on Github actions only"
This reverts commit 0fefd3b.
1 parent 743736c commit b2d7ca4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

misp_stix_converter/misp_stix_converter.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -621,18 +621,18 @@ def misp_to_stix2(filename: _files_type, debug: Optional[bool] = False,
621621
if version not in _STIX2_valid_versions:
622622
version = _STIX2_default_version
623623
parser = MISPtoSTIX21Parser() if version == '2.1' else MISPtoSTIX20Parser()
624-
# try:
625-
if not isinstance(filename, Path):
626-
filename = Path(filename).resolve()
627-
parser.parse_json_file(filename)
628-
name = _check_filename(
629-
filename.parent, f'{filename.name}.out', output_dir, output_name
630-
)
631-
with open(name, 'wt', encoding='utf-8') as f:
632-
f.write(json.dumps(parser.bundle, cls=STIXJSONEncoder, indent=4))
633-
return _generate_traceback(debug, parser, name)
634-
# except Exception as exception:
635-
# return {'fails': [f'{filename} - {exception.__str__()}']}
624+
try:
625+
if not isinstance(filename, Path):
626+
filename = Path(filename).resolve()
627+
parser.parse_json_content(filename)
628+
name = _check_filename(
629+
filename.parent, f'{filename.name}.out', output_dir, output_name
630+
)
631+
with open(name, 'wt', encoding='utf-8') as f:
632+
f.write(json.dumps(parser.bundle, cls=STIXJSONEncoder, indent=4))
633+
return _generate_traceback(debug, parser, name)
634+
except Exception as exception:
635+
return {'fails': [f'{filename} - {exception.__str__()}']}
636636

637637

638638
################################################################################

0 commit comments

Comments
 (0)