From 18fe3e41e9ee724ded8fa4e4021af320685e21ea Mon Sep 17 00:00:00 2001 From: earthmant Date: Mon, 23 Nov 2015 18:07:51 +0200 Subject: [PATCH] Support default ACL in a VPC a vpc usually has a default acl this makes sure that moto flags it and that the describe response has it in there --- moto/ec2/models.py | 6 ++++-- moto/ec2/responses/network_acls.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/moto/ec2/models.py b/moto/ec2/models.py index 098e86328..cf45546fe 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -2610,10 +2610,12 @@ class NetworkAcl(TaggedEC2Resource): self.vpc_id = vpc_id self.network_acl_entries = [] self.associations = {} - self.default = default + self.default = 'true' if default is True else 'false' def get_filter_value(self, filter_name): - if filter_name == "vpc-id": + if filter_name == "default": + return self.default + elif filter_name == "vpc-id": return self.vpc_id elif filter_name == "association.network-acl-id": return self.id diff --git a/moto/ec2/responses/network_acls.py b/moto/ec2/responses/network_acls.py index 684bf6821..ac90021a8 100644 --- a/moto/ec2/responses/network_acls.py +++ b/moto/ec2/responses/network_acls.py @@ -96,7 +96,7 @@ DESCRIBE_NETWORK_ACL_RESPONSE = """ {{ network_acl.id }} {{ network_acl.vpc_id }} - true + {{ network_acl.default }} {% for entry in network_acl.network_acl_entries %}