From f2b7ba03b4cd8d46621dafbe4da98a69c1b775ee Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Fri, 17 Mar 2017 02:45:58 +0000 Subject: [PATCH] Forgot that lstrip works on character sets, not substrings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I suppose this is one way to do it. I could have also split and taken the last element. Not sure which is best. 🤔 --- moto/route53/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moto/route53/models.py b/moto/route53/models.py index e3896a1c..b823cb91 100644 --- a/moto/route53/models.py +++ b/moto/route53/models.py @@ -277,7 +277,7 @@ class Route53Backend(BaseBackend): return self.zones.values() def get_hosted_zone(self, id_): - return self.zones.get(id_.lstrip("/hostedzone/")) + return self.zones.get(id_.replace("/hostedzone/", "")) def get_hosted_zone_by_name(self, name): for zone in self.get_all_hosted_zones(): @@ -285,7 +285,7 @@ class Route53Backend(BaseBackend): return zone def delete_hosted_zone(self, id_): - return self.zones.pop(id_.lstrip("/hostedzone/"), None) + return self.zones.pop(id_.replace("/hostedzone/", ""), None) def create_health_check(self, health_check_args): health_check_id = str(uuid.uuid4())