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

Commit e6f9a8d

Browse files
committed
[client] now use internal id when possible for patch operations
1 parent ff95147 commit e6f9a8d

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,11 +2418,8 @@ def apply_patch_files(self, item):
24182418
field_patch_files = next(
24192419
(op for op in field_patch if op["key"] == "x_opencti_files"), None
24202420
)
2421-
item_id = self.opencti.get_attribute_in_extension(
2422-
"id", item
2423-
)
2421+
item_id = self.opencti.get_attribute_in_extension("id", item)
24242422
worker_logger = self.opencti.logger_class("worker")
2425-
worker_logger.warning("id found: " + item_id)
24262423
if item_id is None:
24272424
item_id = item["id"]
24282425
do_add_file = self.opencti.stix_domain_object.add_file
@@ -2452,9 +2449,7 @@ def apply_patch(self, item):
24522449
field_patch_without_files = [
24532450
op for op in field_patch if op["key"] != "x_opencti_files"
24542451
]
2455-
item_id = self.opencti.get_attribute_in_extension(
2456-
"id", item
2457-
)
2452+
item_id = self.opencti.get_attribute_in_extension("id", item)
24582453
if item_id is None:
24592454
item_id = item["id"]
24602455
if len(field_patch_without_files) > 0:
@@ -2719,10 +2714,6 @@ def import_item(
27192714
# Platform does not know what to do and raises an error:
27202715
# That also works for missing reference with too much execution
27212716
else:
2722-
worker_logger.error(
2723-
"Message reprocess for bad gateway",
2724-
{"count": processing_count},
2725-
)
27262717
bundles_technical_error_counter.add(1)
27272718
if work_id is not None:
27282719
item_str = json.dumps(item)

0 commit comments

Comments
 (0)