Merge pull request #467 from EarthmanT/support_default_filter_network_acl

Support Associate NetworkACL and Filtering in Describe
This commit is contained in:
Steve Pulec 2015-11-26 09:41:13 -05:00
commit 025445d23e
2 changed files with 6 additions and 3 deletions

View File

@ -2597,6 +2597,7 @@ class NetworkAclAssociation(object):
subnet_id, network_acl_id): subnet_id, network_acl_id):
self.ec2_backend = ec2_backend self.ec2_backend = ec2_backend
self.id = new_association_id self.id = new_association_id
self.new_association_id = new_association_id
self.subnet_id = subnet_id self.subnet_id = subnet_id
self.network_acl_id = network_acl_id self.network_acl_id = network_acl_id
super(NetworkAclAssociation, self).__init__() super(NetworkAclAssociation, self).__init__()
@ -2609,10 +2610,12 @@ class NetworkAcl(TaggedEC2Resource):
self.vpc_id = vpc_id self.vpc_id = vpc_id
self.network_acl_entries = [] self.network_acl_entries = []
self.associations = {} self.associations = {}
self.default = default self.default = 'true' if default is True else 'false'
def get_filter_value(self, filter_name): 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 return self.vpc_id
elif filter_name == "association.network-acl-id": elif filter_name == "association.network-acl-id":
return self.id return self.id

View File

@ -96,7 +96,7 @@ DESCRIBE_NETWORK_ACL_RESPONSE = """
<item> <item>
<networkAclId>{{ network_acl.id }}</networkAclId> <networkAclId>{{ network_acl.id }}</networkAclId>
<vpcId>{{ network_acl.vpc_id }}</vpcId> <vpcId>{{ network_acl.vpc_id }}</vpcId>
<default>true</default> <default>{{ network_acl.default }}</default>
<entrySet> <entrySet>
{% for entry in network_acl.network_acl_entries %} {% for entry in network_acl.network_acl_entries %}
<item> <item>