Skip to content

Commit 7830a46

Browse files
author
Samuel Hassine
committed
[client] Formatting the Python code
1 parent 607c3d5 commit 7830a46

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

examples/export_incident_stix2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
# Write the bundle
2323
f = open("My new incident.json", "w")
2424
f.write(json_bundle)
25-
f.close()
25+
f.close()

pycti/entities/opencti_stix_relation.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,20 @@ def to_stix2(self, **kwargs):
627627
if id is not None and entity is None:
628628
entity = self.read(id=id)
629629
if entity is not None:
630-
roles = self.opencti.resolve_role(entity["relationship_type"], entity["from"]["entity_type"], entity["to"]["entity_type"])
630+
roles = self.opencti.resolve_role(
631+
entity["relationship_type"],
632+
entity["from"]["entity_type"],
633+
entity["to"]["entity_type"],
634+
)
631635
if roles is not None:
632636
final_from_id = entity["from"]["stix_id_key"]
633637
final_to_id = entity["to"]["stix_id_key"]
634638
else:
635-
roles = self.opencti.resolve_role(entity["relationship_type"], entity["to"]["entity_type"], entity["from"]["entity_type"])
639+
roles = self.opencti.resolve_role(
640+
entity["relationship_type"],
641+
entity["to"]["entity_type"],
642+
entity["from"]["entity_type"],
643+
)
636644
if roles is not None:
637645
final_from_id = entity["to"]["stix_id_key"]
638646
final_to_id = entity["from"]["stix_id_key"]

0 commit comments

Comments
 (0)