Skip to content

Commit 2433cb0

Browse files
committed
black and lint fixes
1 parent 605447b commit 2433cb0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

st2common/bin/migrations/v3.9/st2-migrate-liveaction-executiondb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ from st2common.models.db.execution import ActionExecutionDB
4545
from st2common.constants.action import (
4646
LIVEACTION_COMPLETED_STATES,
4747
LIVEACTION_STATUS_PAUSED,
48-
LIVEACTION_STATUS_PENDING
48+
LIVEACTION_STATUS_PENDING,
4949
)
5050

5151
# 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) -
6969
res_count = ActionExecutionDB.objects(
7070
__raw__={
7171
"status": {
72-
"$in": LIVEACTION_COMPLETED_STATES + [LIVEACTION_STATUS_PAUSED, LIVEACTION_STATUS_PENDING],
72+
"$in": LIVEACTION_COMPLETED_STATES
73+
+ [LIVEACTION_STATUS_PAUSED, LIVEACTION_STATUS_PENDING],
7374
},
7475
},
7576
start_timestamp__gte=start_dt,
@@ -80,13 +81,14 @@ def migrate_executions(start_dt: datetime.datetime, end_dt: datetime.datetime) -
8081
ActionExecutionDB.objects(__raw__={"_id": item["_id"]}).update(
8182
__raw__={"$set": {"liveaction_id": item["liveaction"]["id"]}}
8283
)
83-
except KeyError as e:
84+
except KeyError:
8485
pass
8586

8687
ActionExecutionDB.objects(
8788
__raw__={
8889
"status": {
89-
"$in": LIVEACTION_COMPLETED_STATES + [LIVEACTION_STATUS_PAUSED, LIVEACTION_STATUS_PENDING],
90+
"$in": LIVEACTION_COMPLETED_STATES
91+
+ [LIVEACTION_STATUS_PAUSED, LIVEACTION_STATUS_PENDING],
9092
},
9193
},
9294
start_timestamp__gte=start_dt,

0 commit comments

Comments
 (0)