Skip to content

Commit

Permalink
Merge 4afce03 into bfff745
Browse files Browse the repository at this point in the history
  • Loading branch information
Prabhakaran Thatchinamoorthy committed Mar 3, 2016
2 parents bfff745 + 4afce03 commit 309ee08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion License2Deploy/rolling_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def lb_healthcheck(self, new_ids, attempt=0, wait_time=0):
logging.info('ELB healthcheck OK')
return True

def confirm_lb_has_only_new_instances(self, wait_time=60):
def confirm_lb_has_only_new_instances(self, wait_time=120):
''' Confirm that only new instances with the current build tag are in the load balancer '''
sleep(wait_time) # Allotting time for the instances to shut down
instance_ids = self.conn_elb.describe_instance_health(self.load_balancer)
Expand Down
9 changes: 5 additions & 4 deletions tests/rolling_deploy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@ def get_autoscaling_configurations(self, launch_configuration_name, autoscaling_
}

@mock_autoscaling
def setUpAutoScaleGroup(self, configurations):
def setUpAutoScaleGroup(self, configurations, env="stg"):
conn = boto.connect_autoscale()
for configuration in configurations:
config = LaunchConfiguration(
name=configuration[self.launch_configuration_name],
image_id='ami-abcd1234',
instance_type='m1.medium',
)
load_balancer_name = 'servergmsextenderELB{0}'.format(env)
group = AutoScalingGroup(
name=configuration[self.autoscaling_group_name],
availability_zones=['us-east-1a'],
Expand All @@ -53,7 +54,7 @@ def setUpAutoScaleGroup(self, configurations):
max_size=10,
min_size=2,
launch_config=config,
load_balancers=['servergmsextenderELBstg'],
load_balancers=[load_balancer_name],
vpc_zone_identifier='subnet-1234abcd',
termination_policies=["Default"],
)
Expand Down Expand Up @@ -185,9 +186,8 @@ def test_get_autoscale_group_name_prd(self):
self.setUpELB(env='prd')
self.rolling_deploy = RollingDeploy('prd', 'server-gms-extender', '0', 'ami-test212', None, './regions.yml')
autoscaling_configurations = list()
autoscaling_configurations.append(self.get_autoscaling_configurations(self.GMS_LAUNCH_CONFIGURATION_STG, self.GMS_AUTOSCALING_GROUP_STG))
autoscaling_configurations.append(self.get_autoscaling_configurations(self.GMS_LAUNCH_CONFIGURATION_PRD, self.GMS_AUTOSCALING_GROUP_PRD))
self.setUpAutoScaleGroup(autoscaling_configurations)
self.setUpAutoScaleGroup(autoscaling_configurations, env='prd')
group = self.rolling_deploy.get_autoscale_group_name()
self.assertEqual(group, self.GMS_AUTOSCALING_GROUP_PRD)
self.assertNotEqual(group, self.GMS_AUTOSCALING_GROUP_STG)
Expand Down Expand Up @@ -215,6 +215,7 @@ def test_get_instance_ip_addrs(self):
@mock_autoscaling
@mock_elb
def test_get_all_instance_ids(self):
self.setUpELB(env='stg')
self.setUpAutoScaleGroup([self.get_autoscaling_configurations(self.GMS_LAUNCH_CONFIGURATION_STG, self.GMS_AUTOSCALING_GROUP_STG)])
conn = boto.connect_ec2()
reservation = conn.run_instances('ami-1234abcd', min_count=2, private_ip_address="10.10.10.10")
Expand Down

0 comments on commit 309ee08

Please sign in to comment.