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,