From f34e26217597c57607e604fb357f5e41500df326 Mon Sep 17 00:00:00 2001 From: "er.ankit.cs" Date: Sat, 8 Feb 2020 04:24:05 +1100 Subject: [PATCH] Fixed bug in setupcdn command. --- 01-webotron/webotron/webotron.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/01-webotron/webotron/webotron.py b/01-webotron/webotron/webotron.py index 0c99123..37b587b 100644 --- a/01-webotron/webotron/webotron.py +++ b/01-webotron/webotron/webotron.py @@ -109,7 +109,6 @@ def find_cert(domain): def setup_cdn(domain, bucket): """To Setup a cloud frot for given domain and bucket.""" dist = dist_manager.find_matching_dist(domain) - print("Distribution aleady exists. Creating Alias Record.") if not dist: cert = cert_manager.find_matching_cert(domain) if not cert: @@ -118,6 +117,9 @@ def setup_cdn(domain, bucket): dist = dist_manager.create_dist(domain, cert) print("Waiting for distribution deployment...") dist_manager.await_deploy(dist) + else: + print("Distribution aleady exists. Creating Alias Record.") + zone = domain_manager.find_hosted_zones(domain) \ or domain_manager.create_hosted_zone(domain) domain_manager.create_cf_domain_record(zone, domain, dist['DomainName'])