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

Commit 62453df

Browse files
author
Samuel Hassine
committed
[client] Prepare to release new version
1 parent f627ea9 commit 62453df

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

pycti/utils/opencti_stix2.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -170,18 +170,20 @@ def extract_embedded_relationships(self, stix_object, types=None):
170170
tags_ids = []
171171
if CustomProperties.TAG_TYPE in stix_object:
172172
for tag in stix_object[CustomProperties.TAG_TYPE]:
173-
if tag["id"] in self.mapping_cache:
174-
tag_result = self.mapping_cache[tag["id"]]
175-
else:
176-
tag_result = self.opencti.tag.read(id=tag["id"])
177-
if tag_result is not None:
178-
self.mapping_cache[tag["id"]] = {"id": tag_result["id"]}
173+
tag_result = None
174+
if "id" in tag:
175+
if tag["id"] in self.mapping_cache:
176+
tag_result = self.mapping_cache[tag["id"]]
179177
else:
180-
tag_result = self.opencti.tag.create(
181-
tag_type=tag["tag_type"],
182-
value=tag["value"],
183-
color=tag["color"],
184-
)
178+
tag_result = self.opencti.tag.read(id=tag["id"])
179+
if tag_result is not None:
180+
self.mapping_cache[tag["id"]] = {"id": tag_result["id"]}
181+
else:
182+
tag_result = self.opencti.tag.create(
183+
tag_type=tag["tag_type"],
184+
value=tag["value"],
185+
color=tag["color"],
186+
)
185187
if tag_result is not None:
186188
tags_ids.append(tag_result["id"])
187189

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
print("warning: pypandoc module not found, could not convert Markdown to RST")
1414
read_md = lambda f: open(f, "r").read()
1515

16-
VERSION = "2.1.11"
16+
VERSION = "2.1.12"
1717

1818

1919
class VerifyVersionCommand(install):

0 commit comments

Comments
 (0)