Skip to content

Commit cf4b880

Browse files
committed
Made pylint happy.
1 parent 1b84e52 commit cf4b880

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
# You shouldn't have to modify anything below here.
6565
################################################################################
6666

67+
import botocore
6768
import boto3
6869
import os
6970
import getopt
@@ -148,7 +149,6 @@ def delete_alarm(cw, alarmName):
148149
cw.delete_alarms(AlarmNames=[alarmName])
149150
else:
150151
print(f'Would have deleted alarm {alarmName}.')
151-
return
152152

153153
################################################################################
154154
# This function checks to see if the alarm already exists.
@@ -236,13 +236,11 @@ def lambda_handler(event, context):
236236

237237
if len(SNStopic) == 0:
238238
raise Exception("You must specify a SNS topic to send the alarm messages to.")
239-
return
240239

241240
if len(accountId) == 0:
242241
raise Exception("You must specify an accountId to run this program.")
243-
return
244242

245-
if len(regions) == 0:
243+
if len(regions) == 0: # pylint: disable=E0601
246244
ec2Client = boto3.client('ec2')
247245
ec2Regions = ec2Client.describe_regions()['Regions']
248246
for region in ec2Regions:
@@ -382,7 +380,7 @@ def usage():
382380
elif currentArgument in ("-a", "--accountID"):
383381
accountId = currentValue
384382
elif currentArgument in ("-s", "--SNSTopic"):
385-
snsTopic = currentValue
383+
SNStopic = currentValue
386384
elif currentArgument in ("-C", "--CPUThreshold"):
387385
defaultCPUThreshold = int(currentValue)
388386
elif currentArgument in ("-S", "--SSDThreshold"):

0 commit comments

Comments
 (0)