From 798bd78d7c94d8849fe655d3cd61642a8a9ed482 Mon Sep 17 00:00:00 2001 From: guzzijones Date: Tue, 10 Oct 2023 18:18:29 +0000 Subject: [PATCH] black and lint fixes --- .../migrations/v3.9/st2-migrate-liveaction-executiondb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/st2common/bin/migrations/v3.9/st2-migrate-liveaction-executiondb b/st2common/bin/migrations/v3.9/st2-migrate-liveaction-executiondb index 0fea53a29b..76e69bc845 100755 --- a/st2common/bin/migrations/v3.9/st2-migrate-liveaction-executiondb +++ b/st2common/bin/migrations/v3.9/st2-migrate-liveaction-executiondb @@ -45,7 +45,7 @@ from st2common.models.db.execution import ActionExecutionDB from st2common.constants.action import ( LIVEACTION_COMPLETED_STATES, LIVEACTION_STATUS_PAUSED, - LIVEACTION_STATUS_PENDING + LIVEACTION_STATUS_PENDING, ) # NOTE: To avoid unnecessary mongoengine object churn when retrieving only object ids (aka to avoid @@ -69,7 +69,8 @@ def migrate_executions(start_dt: datetime.datetime, end_dt: datetime.datetime) - res_count = ActionExecutionDB.objects( __raw__={ "status": { - "$in": LIVEACTION_COMPLETED_STATES + [LIVEACTION_STATUS_PAUSED, LIVEACTION_STATUS_PENDING], + "$in": LIVEACTION_COMPLETED_STATES + + [LIVEACTION_STATUS_PAUSED, LIVEACTION_STATUS_PENDING], }, }, start_timestamp__gte=start_dt, @@ -80,13 +81,14 @@ def migrate_executions(start_dt: datetime.datetime, end_dt: datetime.datetime) - ActionExecutionDB.objects(__raw__={"_id": item["_id"]}).update( __raw__={"$set": {"liveaction_id": item["liveaction"]["id"]}} ) - except KeyError as e: + except KeyError: pass ActionExecutionDB.objects( __raw__={ "status": { - "$in": LIVEACTION_COMPLETED_STATES + [LIVEACTION_STATUS_PAUSED, LIVEACTION_STATUS_PENDING], + "$in": LIVEACTION_COMPLETED_STATES + + [LIVEACTION_STATUS_PAUSED, LIVEACTION_STATUS_PENDING], }, }, start_timestamp__gte=start_dt,