replacing the usage
of dhcp_opt_ids_from_querystring with sequence_from_querystring
This commit is contained in:
parent
41873b59f7
commit
c5bf9d8c94
@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
|||||||
from moto.core.responses import BaseResponse
|
from moto.core.responses import BaseResponse
|
||||||
from moto.ec2.utils import (
|
from moto.ec2.utils import (
|
||||||
filters_from_querystring,
|
filters_from_querystring,
|
||||||
dhcp_opt_ids_from_querystring,
|
sequence_from_querystring,
|
||||||
dhcp_configuration_from_querystring)
|
dhcp_configuration_from_querystring)
|
||||||
|
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ class DHCPOptions(BaseResponse):
|
|||||||
return template.render(delete_status=delete_status)
|
return template.render(delete_status=delete_status)
|
||||||
|
|
||||||
def describe_dhcp_options(self):
|
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):
|
if filters_from_querystring(self.querystring):
|
||||||
raise NotImplementedError("Filtering not supported in describe_dhcp_options.")
|
raise NotImplementedError("Filtering not supported in describe_dhcp_options.")
|
||||||
dhcp_opts = self.ec2_backend.get_all_dhcp_options(dhcp_opt_ids, None)
|
dhcp_opts = self.ec2_backend.get_all_dhcp_options(dhcp_opt_ids, None)
|
||||||
|
@ -185,14 +185,6 @@ def network_acl_ids_from_querystring(querystring_dict):
|
|||||||
return network_acl_ids
|
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):
|
def vpc_ids_from_querystring(querystring_dict):
|
||||||
vpc_ids = []
|
vpc_ids = []
|
||||||
for key, value in querystring_dict.items():
|
for key, value in querystring_dict.items():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user