From 61f12228e72c7cc4ac5b00c55623b7c010f94811 Mon Sep 17 00:00:00 2001 From: janus-anderwelt <110822579+janus-anderwelt@users.noreply.github.com> Date: Fri, 23 Sep 2022 15:21:11 +0200 Subject: [PATCH] fix asg bug --- amicleaner/fetch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amicleaner/fetch.py b/amicleaner/fetch.py index 015a3bb..5dccf00 100644 --- a/amicleaner/fetch.py +++ b/amicleaner/fetch.py @@ -67,7 +67,7 @@ def fetch_zeroed_asg(self): resp = self.asg.describe_auto_scaling_groups() zeroed_lcs = [asg.get("LaunchConfigurationName", "") for asg in resp.get("AutoScalingGroups", []) - if asg.get("DesiredCapacity", 0) == 0] + if asg.get("DesiredCapacity", 0) == 0 and asg.get("LaunchConfigurationName", None) is not None] resp = self.asg.describe_launch_configurations( LaunchConfigurationNames=zeroed_lcs