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

Commit 91dfcfe

Browse files
author
Samuel Hassine
committed
[client] Fix Black format
1 parent cd5e02b commit 91dfcfe

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

pycti/entities/opencti_stix_domain_entity.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -503,14 +503,12 @@ def add_file(self, **kwargs):
503503
if id is not None and file_name is not None:
504504
stix_domain_entity = self.read(id=id)
505505
if stix_domain_entity is None:
506-
self.opencti.log(
507-
"error", "Cannot add File, entity not found"
508-
)
506+
self.opencti.log("error", "Cannot add File, entity not found")
509507
return False
510508
final_file_name = os.path.basename(file_name)
511509
current_files = {}
512-
for file in stix_domain_entity['importFiles']:
513-
current_files[file['name']] = file
510+
for file in stix_domain_entity["importFiles"]:
511+
current_files[file["name"]] = file
514512
if final_file_name in current_files:
515513
return current_files[final_file_name]
516514
else:
@@ -532,7 +530,8 @@ def add_file(self, **kwargs):
532530
mime_type = magic.from_file(file_name, mime=True)
533531

534532
return self.opencti.query(
535-
query, {"id": id, "file": (self.file(final_file_name, data, mime_type))}
533+
query,
534+
{"id": id, "file": (self.file(final_file_name, data, mime_type))},
536535
)
537536
else:
538537
self.opencti.log(

pycti/utils/opencti_stix2.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def extract_embedded_relationships(self, stix_object, types=None):
180180
tag_result = self.opencti.tag.create(
181181
tag_type=tag["tag_type"],
182182
value=tag["value"],
183-
color=tag["color"]
183+
color=tag["color"],
184184
)
185185
if tag_result is not None:
186186
tags_ids.append(tag_result["id"])
@@ -512,9 +512,9 @@ def import_object(self, stix_object, update=False, types=None):
512512
if CustomProperties.FILES in stix_object:
513513
for file in stix_object[CustomProperties.FILES]:
514514
self.opencti.stix_domain_entity.add_file(
515-
file_name=file['name'],
516-
data=base64.b64decode(file['data']),
517-
mime_type=file['mime_type']
515+
file_name=file["name"],
516+
data=base64.b64decode(file["data"]),
517+
mime_type=file["mime_type"],
518518
)
519519

520520
return stix_object_results

0 commit comments

Comments
 (0)