Route53 Zone.update_record() fix [spulec/moto#83]

* Zone.update_record() issues what is essentially a batched update to
   the AWS Route53 API: It's a DELETE followed by a CREATE.  This fix
   allow moto to handle that batched update.
This commit is contained in:
Vincent Rivellino 2014-01-24 14:34:53 -05:00
parent 262b698149
commit eb93a2bcd1

View File

@ -45,7 +45,12 @@ def rrset_response(request, full_url, headers):
if method == "POST": if method == "POST":
elements = xmltodict.parse(request.body) elements = xmltodict.parse(request.body)
for key, value in elements['ChangeResourceRecordSetsRequest']['ChangeBatch']['Changes'].items():
change_list = elements['ChangeResourceRecordSetsRequest']['ChangeBatch']['Changes']['Change']
if not isinstance(change_list, list):
change_list = [elements['ChangeResourceRecordSetsRequest']['ChangeBatch']['Changes']['Change']]
for value in change_list:
action = value['Action'] action = value['Action']
rrset = value['ResourceRecordSet'] rrset = value['ResourceRecordSet']