From 6045079f01e06c6c42961cde7631eb29ef1196f7 Mon Sep 17 00:00:00 2001 From: Feanil Patel <feanil@edx.org> Date: Fri, 31 Jan 2014 15:48:23 -0500 Subject: [PATCH] Add an env tag to studio and edxapp dns names. --- util/vpc-tools/vpc_dns.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/vpc-tools/vpc_dns.py b/util/vpc-tools/vpc_dns.py index 971fba4..ca72b11 100644 --- a/util/vpc-tools/vpc_dns.py +++ b/util/vpc-tools/vpc_dns.py @@ -149,6 +149,7 @@ def update_elb_rds_dns(zone): stack_elbs = [elb for elb in elb_con.get_all_load_balancers() if elb.vpc_id == vpc_id] + for elb in stack_elbs: for inst in elb.instances: instance = ec2_con.get_all_instances( @@ -160,13 +161,12 @@ def update_elb_rds_dns(zone): else: # deprecated, for backwards compatibility play_tag = instance.tags['role'] - play_tag = instance.tags['role'] fqdn = "{}-{}.{}".format(env_tag, play_tag, zone_name) add_or_update_record(zone, fqdn, 'CNAME', 600, [elb.dns_name]) if play_tag == 'edxapp': # create courses and studio CNAME records for edxapp for name in ['courses', 'studio']: - fqdn = "{}.{}".format(name, zone_name) + fqdn = "{}-{}.{}".format(env_tag, name, zone_name) add_or_update_record(zone, fqdn, 'CNAME', 600, [elb.dns_name]) break # only need the first instance for tag info -- libgit2 0.26.0