Merge pull request #867 from 2rs2ts/flexible-route53-hostedzoneid-lookup

Be flexible with Route53 Hosted Zone IDs with /hostedzone/ prefix
This commit is contained in:
Steve Pulec 2017-03-16 22:55:13 -04:00 committed by GitHub
commit a6e762340d

View File

@ -277,7 +277,7 @@ class Route53Backend(BaseBackend):
return self.zones.values()
def get_hosted_zone(self, id_):
return self.zones.get(id_)
return self.zones.get(id_.replace("/hostedzone/", ""))
def get_hosted_zone_by_name(self, name):
for zone in self.get_all_hosted_zones():
@ -285,10 +285,7 @@ class Route53Backend(BaseBackend):
return zone
def delete_hosted_zone(self, id_):
zone = self.zones.get(id_)
if zone:
del self.zones[id_]
return zone
return self.zones.pop(id_.replace("/hostedzone/", ""), None)
def create_health_check(self, health_check_args):
health_check_id = str(uuid.uuid4())