VPCs can now be filtered by cider block and dhcp options id

This commit is contained in:
Omer Katz 2014-09-30 17:29:50 +03:00 committed by Omer Katz
commit ecb23485d0
2 changed files with 47 additions and 2 deletions

View file

@ -1134,6 +1134,14 @@ class VPC(TaggedEC2Instance):
return self.id
def get_filter_value(self, filter_name):
if filter_name == 'cidr':
return self.cidr_block
elif filter_name == 'dhcp-options-id':
if not self.dhcp_options:
return None
return self.dhcp_options.id
msg = "The filter '{0}' for DescribeVPCs has not been" \
" implemented in Moto yet. Feel free to open an issue at" \
" https://github.com/spulec/moto/issues".format(filter_name)