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

Commit 7c84207

Browse files
[client] Fix formatting
1 parent 4506e54 commit 7c84207

File tree

7 files changed

+25
-18
lines changed

7 files changed

+25
-18
lines changed

pycti/entities/opencti_label.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ def update_field(self, **kwargs):
170170
else:
171171
value = str(value)
172172
if id is not None and key is not None and value is not None:
173-
self.opencti.log(
174-
"info", "Updating Label {" + id + "} field {" + key + "}."
175-
)
173+
self.opencti.log("info", "Updating Label {" + id + "} field {" + key + "}.")
176174
query = """
177175
mutation LabelEdit($id: ID!, $input: EditInput!, $operation: EditOperation) {
178176
labelEdit(id: $id) {

pycti/entities/opencti_report.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,9 @@ def import_from_stix2(self, **kwargs):
605605
report_types=stix_object["report_types"]
606606
if "report_types" in stix_object
607607
else None,
608-
published=stix_object["published"] if "published" in stix_object else None,
608+
published=stix_object["published"]
609+
if "published" in stix_object
610+
else None,
609611
x_opencti_graph_data=stix_object["x_opencti_graph_data"]
610612
if "x_opencti_graph_data" in stix_object
611613
else None,

pycti/entities/opencti_stix.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,5 @@ def delete(self, **kwargs):
3030
"""
3131
self.opencti.query(query, {"id": id})
3232
else:
33-
self.opencti.log(
34-
"error", "[opencti_stix] Missing parameters: id"
35-
)
33+
self.opencti.log("error", "[opencti_stix] Missing parameters: id")
3634
return None
37-

pycti/entities/opencti_stix_core_object.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ def merge(self, **kwargs):
2525
stix_core_objects_ids = kwargs.get("object_ids", None)
2626
if id is not None and stix_core_objects_ids is not None:
2727
self.opencti.log(
28-
"info", "Merging Core object {" + id + "} with {" + ','.join(stix_core_objects_ids) + "}."
28+
"info",
29+
"Merging Core object {"
30+
+ id
31+
+ "} with {"
32+
+ ",".join(stix_core_objects_ids)
33+
+ "}.",
2934
)
3035
query = """
3136
mutation StixCoreObjectEdit($id: ID!, $stixCoreObjectsIds: [String]!) {

pycti/entities/opencti_stix_core_relationship.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,12 @@ def update_field(self, **kwargs):
558558
}
559559
"""
560560
result = self.opencti.query(
561-
query, {
561+
query,
562+
{
562563
"id": id,
563564
"input": {"key": key, "value": value},
564-
"operation": operation
565-
}
565+
"operation": operation,
566+
},
566567
)
567568
return self.opencti.process_multiple_fields(
568569
result["data"]["stixCoreRelationshipEdit"]["fieldPatch"]

pycti/entities/opencti_stix_sighting_relationship.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,12 @@ def update_field(self, **kwargs):
540540
}
541541
"""
542542
result = self.opencti.query(
543-
query, {
543+
query,
544+
{
544545
"id": id,
545546
"input": {"key": key, "value": value},
546547
"operation": operation,
547-
}
548+
},
548549
)
549550
return self.opencti.process_multiple_fields(
550551
result["data"]["stixSightingRelationshipEdit"]["fieldPatch"]
@@ -604,7 +605,7 @@ def add_marking_definition(self, **kwargs):
604605
+ "} to stix_sighting_relationship {"
605606
+ id
606607
+ "}",
607-
)
608+
)
608609
query = """
609610
mutation StixSightingRelationshipEdit($id: ID!, $input: StixMetaRelationshipAddInput) {
610611
stixSightingRelationshipEdit(id: $id) {
@@ -650,7 +651,7 @@ def remove_marking_definition(self, **kwargs):
650651
+ "} from stix_sighting_relationship {"
651652
+ id
652653
+ "}",
653-
)
654+
)
654655
query = """
655656
mutation StixSightingRelationshipEdit($id: ID!, $toId: String!, $relationship_type: String!) {
656657
stixSightingRelationshipEdit(id: $id) {
@@ -692,7 +693,7 @@ def update_created_by(self, **kwargs):
692693
+ "} with Identity {"
693694
+ str(identity_id)
694695
+ "}",
695-
)
696+
)
696697
custom_attributes = """
697698
id
698699
createdBy {

pycti/utils/opencti_stix2.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,10 @@ def import_bundle(
15351535
if "x_data_update" in item:
15361536
self.stix2_update.process_update_v1(item)
15371537
continue
1538-
elif bundle["x_opencti_event_version"] == "2" or bundle["x_opencti_event_version"] == "3":
1538+
elif (
1539+
bundle["x_opencti_event_version"] == "2"
1540+
or bundle["x_opencti_event_version"] == "3"
1541+
):
15391542
if "x_opencti_patch" in item:
15401543
self.stix2_update.process_update_v2(item)
15411544
continue

0 commit comments

Comments
 (0)