From c5bf9d8c94743aaf982ff73990a1346bbed05734 Mon Sep 17 00:00:00 2001 From: earthmant Date: Thu, 3 Dec 2015 13:49:08 +0200 Subject: [PATCH] replacing the usage of dhcp_opt_ids_from_querystring with sequence_from_querystring --- moto/ec2/responses/dhcp_options.py | 4 ++-- moto/ec2/utils.py | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/moto/ec2/responses/dhcp_options.py b/moto/ec2/responses/dhcp_options.py index 55542e069..57d16a015 100644 --- a/moto/ec2/responses/dhcp_options.py +++ b/moto/ec2/responses/dhcp_options.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from moto.core.responses import BaseResponse from moto.ec2.utils import ( filters_from_querystring, - dhcp_opt_ids_from_querystring, + sequence_from_querystring, dhcp_configuration_from_querystring) @@ -48,7 +48,7 @@ class DHCPOptions(BaseResponse): return template.render(delete_status=delete_status) def describe_dhcp_options(self): - dhcp_opt_ids = dhcp_opt_ids_from_querystring(self.querystring) + dhcp_opt_ids = sequence_from_querystring("DhcpOptionsId", self.querystring) if filters_from_querystring(self.querystring): raise NotImplementedError("Filtering not supported in describe_dhcp_options.") dhcp_opts = self.ec2_backend.get_all_dhcp_options(dhcp_opt_ids, None) diff --git a/moto/ec2/utils.py b/moto/ec2/utils.py index ebad2b82a..b16c363ea 100644 --- a/moto/ec2/utils.py +++ b/moto/ec2/utils.py @@ -185,14 +185,6 @@ def network_acl_ids_from_querystring(querystring_dict): return network_acl_ids -def dhcp_opt_ids_from_querystring(querystring_dict): - dhcp_opt_ids = [] - for key, value in querystring_dict.items(): - if 'DhcpOptionsId' in key: - dhcp_opt_ids.append(value[0]) - return dhcp_opt_ids - - def vpc_ids_from_querystring(querystring_dict): vpc_ids = [] for key, value in querystring_dict.items():