Skip to content

Commit 10d83d1

Browse files
committed
Made lint happy.
1 parent d334112 commit 10d83d1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Monitoring/auto-add-cw-alarms/auto_add_cw_alarms.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
import getopt
8585
import sys
8686
import time
87+
import json
8788

8889
################################################################################
8990
# This function adds the SSD Utilization CloudWatch alarm.
@@ -218,7 +219,8 @@ def getAlarmThresholdTagValue(fsx, arn):
218219
except botocore.exceptions.ClientError as e:
219220
if e.response['Error']['Code'] == 'ResourceNotFound':
220221
return(100) # Return 100 so we don't try to create an alarm.
221-
elif e.response['Error']['Code'] == 'TooManyRequestsException' or e.response['Error']['Code'] == 'ThrottlingException':
222+
223+
if e.response['Error']['Code'] == 'TooManyRequestsException' or e.response['Error']['Code'] == 'ThrottlingException':
222224
sleep = sleep * 2
223225
if sleep > 5:
224226
raise e
@@ -256,11 +258,11 @@ def getSSDAlarmThresholdTagValue(tags):
256258
################################################################################
257259
def getFileSystemId(alarm):
258260

259-
for metric in alarm['Metrics']:
260-
if metric["Id"] == "m1":
261-
for dim in metric['MetricStat']['Metric']['Dimensions']:
262-
if dim['Name'] == 'FileSystemId':
263-
return dim['Value']
261+
for metric in alarm['Metrics']:
262+
if metric["Id"] == "m1":
263+
for dim in metric['MetricStat']['Metric']['Dimensions']:
264+
if dim['Name'] == 'FileSystemId':
265+
return dim['Value']
264266
return None
265267

266268
################################################################################

0 commit comments

Comments
 (0)