Commit 4173320f authored by Bozhidar Zhelev's avatar Bozhidar Zhelev

Merge branch 'while_timeout_on_asg_update' into 'master'

adding timeout for the healthy vs desired while loop no to wait the gitlab...

See merge request !21
parents c5b88554 618588c4
Pipeline #2745 failed with stage
in 18 seconds
......@@ -125,9 +125,16 @@ class ASG():"No output from instance yet. Trying again in 10 seconds.")
# Wait for remaining instances (if any) to come up too
while len(self.asgs_healthy_instances(inactive_asg)) < scale_to['desired']:
# Wait for remaining instances (if any) to come up too (up to 5 minutes = 300 attempts)
attempts = 0
max_attempts = 300
while len(self.asgs_healthy_instances(inactive_asg)) < scale_to['desired'] and attempts != max_attempts:"Waiting for all instances to be healthy ...")
attempts += 1
if attempts == max_attempts:"Max timeout reached without success... Exiting!")
raise exceptions.AkinakaLoggingError"ASG fully healthy. Logging new ASG name to \"inactive_asg.txt\"")
open("inactive_asg.txt", "w").write(inactive_asg)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment