Skip to content

Commit

Permalink
fix: [stix2 import] Fixed the method to directly load and parse STIX …
Browse files Browse the repository at this point in the history
…Bundle giving a filename

- Giving the whole set of required arguments needed
  by the Bundles parsing methods
  • Loading branch information
chrisr3d committed Aug 22, 2024
1 parent 7220ab8 commit 4c4411f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions misp_stix_converter/stix2misp/stix2_to_misp.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,15 +255,14 @@ def load_stix_bundle(self, bundle: Union[Bundle_v20, Bundle_v21]):
self._critical_error(exception)
self.__n_report = 2 if n_report >= 2 else n_report

def parse_stix_content(
self, filename: str, single_event: Optional[bool] = False):
def parse_stix_content(self, filename: str, **kwargs):
try:
bundle = _load_stix2_content(filename)
except Exception as exception:
sys.exit(exception)
self.load_stix_bundle(bundle)
del bundle
self.parse_stix_bundle(single_event)
self.parse_stix_bundle(**kwargs)

def _parse_stix_bundle(self):
try:
Expand Down

0 comments on commit 4c4411f

Please sign in to comment.