diff --git a/moto/route53/models.py b/moto/route53/models.py index 58c559f25..3f7f439e4 100644 --- a/moto/route53/models.py +++ b/moto/route53/models.py @@ -106,9 +106,10 @@ class RecordSet(object): class FakeZone(object): - def __init__(self, name, id_): + def __init__(self, name, id_, comment=None): self.name = name self.id = id_ + self.comment = comment self.rrsets = [] def add_rrset(self, record_set): @@ -170,9 +171,9 @@ class Route53Backend(BaseBackend): self.zones = {} self.health_checks = {} - def create_hosted_zone(self, name): + def create_hosted_zone(self, name, comment=None): new_id = get_random_hex() - new_zone = FakeZone(name, new_id) + new_zone = FakeZone(name, new_id, comment=comment) self.zones[new_id] = new_zone return new_zone diff --git a/moto/route53/responses.py b/moto/route53/responses.py index 5bbb8f451..2eba0778e 100644 --- a/moto/route53/responses.py +++ b/moto/route53/responses.py @@ -9,7 +9,8 @@ def list_or_create_hostzone_response(request, full_url, headers): if request.method == "POST": elements = xmltodict.parse(request.body) - new_zone = route53_backend.create_hosted_zone(elements["CreateHostedZoneRequest"]["Name"]) + comment = elements["CreateHostedZoneRequest"]["HostedZoneConfig"]["Comment"] + new_zone = route53_backend.create_hosted_zone(elements["CreateHostedZoneRequest"]["Name"], comment=comment) template = Template(CREATE_HOSTED_ZONE_RESPONSE) return 201, headers, template.render(zone=new_zone) @@ -125,6 +126,9 @@ GET_HOSTED_ZONE_RESPONSE = """