From 4b59c6b90730a080d10699cb25575f5e5f7316d1 Mon Sep 17 00:00:00 2001 From: earthmant Date: Mon, 23 Nov 2015 15:16:46 +0200 Subject: [PATCH 1/2] Support Associate Network ACL add the new_association_id property to NetworkACL object so that the template render for replace adds the ID and the associate_network_acl receives a response --- moto/ec2/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/moto/ec2/models.py b/moto/ec2/models.py index 446561d33..098e86328 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -2597,6 +2597,7 @@ class NetworkAclAssociation(object): subnet_id, network_acl_id): self.ec2_backend = ec2_backend self.id = new_association_id + self.new_association_id = new_association_id self.subnet_id = subnet_id self.network_acl_id = network_acl_id super(NetworkAclAssociation, self).__init__() From 18fe3e41e9ee724ded8fa4e4021af320685e21ea Mon Sep 17 00:00:00 2001 From: earthmant Date: Mon, 23 Nov 2015 18:07:51 +0200 Subject: [PATCH 2/2] 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 %}