Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 65e6388

Browse files
committed
[client] report expection when element is ignored during import
1 parent f9cd703 commit 65e6388

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

pycti/connector/opencti_connector_helper.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,15 +1918,13 @@ def send_stix2_bundle(self, bundle: str, **kwargs) -> list:
19181918
os.rename(write_file, final_write_file)
19191919

19201920
stix2_splitter = OpenCTIStix2Splitter()
1921-
(
1922-
expectations_number,
1923-
bundles,
1924-
_
1925-
) = stix2_splitter.split_bundle_with_expectations(
1926-
bundle=bundle,
1927-
use_json=True,
1928-
event_version=event_version,
1929-
cleanup_inconsistent_bundle=cleanup_inconsistent_bundle,
1921+
(expectations_number, bundles, _) = (
1922+
stix2_splitter.split_bundle_with_expectations(
1923+
bundle=bundle,
1924+
use_json=True,
1925+
event_version=event_version,
1926+
cleanup_inconsistent_bundle=cleanup_inconsistent_bundle,
1927+
)
19301928
)
19311929

19321930
if len(bundles) == 0:

pycti/utils/opencti_stix2.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2748,8 +2748,10 @@ def import_bundle(
27482748
)
27492749

27502750
stix2_splitter = OpenCTIStix2Splitter()
2751-
_, nb_incompatible_elements, bundles = stix2_splitter.split_bundle_with_expectations(
2752-
stix_bundle, False, event_version
2751+
_, nb_incompatible_elements, bundles = (
2752+
stix2_splitter.split_bundle_with_expectations(
2753+
stix_bundle, False, event_version
2754+
)
27532755
)
27542756

27552757
# Report every element ignored during bundle splitting

0 commit comments

Comments
 (0)