@@ -73,7 +73,7 @@ def lambda_handler(event, lambda_context):
73
73
# Download monitor file
74
74
monitor_file_name = f"{ queueId .split ('Queue' )[0 ]} SpotFleetRequestId.json"
75
75
monitor_local_name = f"/tmp/{ monitor_file_name } "
76
- monitor_on_bucket_name = ( f"monitors/{ monitor_file_name } " )
76
+ monitor_on_bucket_name = f"monitors/{ monitor_file_name } "
77
77
78
78
with open (monitor_local_name , "wb" ) as f :
79
79
try :
@@ -102,7 +102,9 @@ def lambda_handler(event, lambda_context):
102
102
if "ApproximateNumberOfMessagesNotVisible" in event ["Records" ][0 ]["Sns" ]["Message" ]:
103
103
print ("No messages in progress. Cleaning up." )
104
104
ecs .update_service (
105
- cluster = monitorcluster , service = f"{ monitorapp } Service" , desiredCount = 0 ,
105
+ cluster = monitorcluster ,
106
+ service = f"{ monitorapp } Service" ,
107
+ desiredCount = 0 ,
106
108
)
107
109
print ("Service has been downscaled" )
108
110
@@ -176,8 +178,10 @@ def lambda_handler(event, lambda_context):
176
178
)
177
179
178
180
# Remove Cloudwatch dashboard if created and cleanup desired
179
- if CLEAN_DASHBOARD .lower ()== ' true' :
181
+ if CLEAN_DASHBOARD .lower () == " true" :
180
182
dashboard_list = cloudwatch .list_dashboards ()
181
183
for entry in dashboard_list ["DashboardEntries" ]:
182
184
if monitorapp in entry ["DashboardName" ]:
183
- cloudwatch .delete_dashboards (DashboardNames = [entry ["DashboardName" ]])
185
+ cloudwatch .delete_dashboards (
186
+ DashboardNames = [entry ["DashboardName" ]]
187
+ )
0 commit comments