Skip to content

Commit b5c0f80

Browse files
committed
Avoid undeclared variables
The parent exception handler will also display the error so there's not much point in changing these to re-raise.
1 parent b18a7cd commit b5c0f80

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

remove_vpc.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@ def delete_acls(ec2, args):
6161
Delete the network access lists (NACLs)
6262
"""
6363

64-
try:
65-
acls = ec2.describe_network_acls(**args)["NetworkAcls"]
66-
except ClientError as e:
67-
print(e.response["Error"]["Message"])
64+
acls = ec2.describe_network_acls(**args)["NetworkAcls"]
6865

6966
for acl in acls:
7067
is_default = acl["IsDefault"]
@@ -79,10 +76,7 @@ def delete_sgps(ec2, args):
7976
Delete any security groups
8077
"""
8178

82-
try:
83-
sgps = ec2.describe_security_groups(**args)["SecurityGroups"]
84-
except ClientError as e:
85-
print(e.response["Error"]["Message"])
79+
sgps = ec2.describe_security_groups(**args)["SecurityGroups"]
8680

8781
if sgps:
8882
for sgp in sgps:

0 commit comments

Comments
 (0)