Commit d659fe23 authored by Bozhidar Zhelev's avatar Bozhidar Zhelev

Merge branch 'HCSD-7409' into 'master'

[HCSD-7409] Makes sure old ASG is scaled down to 0 after being detached

See merge request !22
parents 16d223d0 d06eb93c
Pipeline #2814 passed with stage
in 26 seconds
......@@ -137,4 +137,22 @@ class TargetGroup():
else:
logging.info("Done!")
# Scale down the old (detached) ASG to 0/0/0
logging.info(f"Scaling down the {active_asg_name} ASG to 0/0/0...")
try:
for asg in active_asg:
asg_client.update_auto_scaling_group(
AutoScalingGroupName=asg['AutoScalingGroupName'],
MinSize=0,
MaxSize=0,
DesiredCapacity=0
)
except Exception as e:
logging.error(f"Could not scale down the old {inactive_asg} ASG!")
logging.error(e)
# FIXME: Raise an exception.AkinakaCriticalException above instead of catching this
exit(1)
else:
logging.info("Done!")
return
......@@ -8,7 +8,7 @@ with open("README.md", "r") as fh:
setuptools.setup(
name="akinaka",
version="0.5.8",
version="0.5.9",
python_requires='>=3.3.0',
author="Afraz",
author_email="afraz@olindata.com",
......
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