@@ -45,7 +45,7 @@ from st2common.models.db.execution import ActionExecutionDB
45
45
from st2common .constants .action import (
46
46
LIVEACTION_COMPLETED_STATES ,
47
47
LIVEACTION_STATUS_PAUSED ,
48
- LIVEACTION_STATUS_PENDING
48
+ LIVEACTION_STATUS_PENDING ,
49
49
)
50
50
51
51
# 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) -
69
69
res_count = ActionExecutionDB .objects (
70
70
__raw__ = {
71
71
"status" : {
72
- "$in" : LIVEACTION_COMPLETED_STATES + [LIVEACTION_STATUS_PAUSED , LIVEACTION_STATUS_PENDING ],
72
+ "$in" : LIVEACTION_COMPLETED_STATES
73
+ + [LIVEACTION_STATUS_PAUSED , LIVEACTION_STATUS_PENDING ],
73
74
},
74
75
},
75
76
start_timestamp__gte = start_dt ,
@@ -80,13 +81,14 @@ def migrate_executions(start_dt: datetime.datetime, end_dt: datetime.datetime) -
80
81
ActionExecutionDB .objects (__raw__ = {"_id" : item ["_id" ]}).update (
81
82
__raw__ = {"$set" : {"liveaction_id" : item ["liveaction" ]["id" ]}}
82
83
)
83
- except KeyError as e :
84
+ except KeyError :
84
85
pass
85
86
86
87
ActionExecutionDB .objects (
87
88
__raw__ = {
88
89
"status" : {
89
- "$in" : LIVEACTION_COMPLETED_STATES + [LIVEACTION_STATUS_PAUSED , LIVEACTION_STATUS_PENDING ],
90
+ "$in" : LIVEACTION_COMPLETED_STATES
91
+ + [LIVEACTION_STATUS_PAUSED , LIVEACTION_STATUS_PENDING ],
90
92
},
91
93
},
92
94
start_timestamp__gte = start_dt ,
0 commit comments