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

Commit 856b785

Browse files
richard-julienSamuelHassine
authored andcommitted
[client] Reformat (opencti/#11707)
1 parent 65ed031 commit 856b785

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

pycti/entities/opencti_security_coverage.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ def create(self, **kwargs):
231231
}
232232
},
233233
)
234-
return self.opencti.process_multiple_fields(result["data"]["securityCoverageAdd"])
234+
return self.opencti.process_multiple_fields(
235+
result["data"]["securityCoverageAdd"]
236+
)
235237
else:
236238
self.opencti.app_logger.error(
237239
"[opencti_security_coverage] "
@@ -260,14 +262,28 @@ def import_from_stix2(self, **kwargs):
260262
)
261263

262264
raw_coverages = stix_object["coverage"] if "coverage" in stix_object else []
263-
coverage_information = list(map(lambda cov: {"coverage_name":cov["name"],"coverage_score":cov["score"]}, raw_coverages))
265+
coverage_information = list(
266+
map(
267+
lambda cov: {
268+
"coverage_name": cov["name"],
269+
"coverage_score": cov["score"],
270+
},
271+
raw_coverages,
272+
)
273+
)
264274

265275
return self.create(
266276
stix_id=stix_object["id"],
267277
name=stix_object["name"],
268-
coverage_last_result=stix_object["last_result"] if "last_result" in stix_object else None,
269-
coverage_valid_from=stix_object["valid_from"] if "valid_from" in stix_object else None,
270-
coverage_valid_to=stix_object["valid_to"] if "valid_to" in stix_object else None,
278+
coverage_last_result=(
279+
stix_object["last_result"] if "last_result" in stix_object else None
280+
),
281+
coverage_valid_from=(
282+
stix_object["valid_from"] if "valid_from" in stix_object else None
283+
),
284+
coverage_valid_to=(
285+
stix_object["valid_to"] if "valid_to" in stix_object else None
286+
),
271287
coverage_information=coverage_information,
272288
description=(
273289
self.opencti.stix2.convert_markdown(stix_object["description"])
@@ -302,4 +318,4 @@ def import_from_stix2(self, **kwargs):
302318
else:
303319
self.opencti.app_logger.error(
304320
"[opencti_security_coverage] Missing parameters: stixObject"
305-
)
321+
)

0 commit comments

Comments
 (0)