Skip to content

Commit

Permalink
Fixed bug in setupcdn command.
Browse files Browse the repository at this point in the history
  • Loading branch information
erankitcs committed Feb 7, 2020
1 parent 6e6e26f commit f34e262
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion 01-webotron/webotron/webotron.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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'])
Expand Down

0 comments on commit f34e262

Please sign in to comment.