Skip to content

Commit 25a5335

Browse files
authored
Update aws.py
fixing a possible bug when the user has some instance without any tag
1 parent 999b414 commit 25a5335

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cuckoo/machinery/aws.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,10 @@ def _is_autoscaled(self, instance):
308308
:param instance: instance object
309309
:return: true if the instance in "autoscaled"
310310
"""
311-
for item in instance.tags:
312-
if item.get("Key") == self.AUTOSCALE_CUCKOO:
313-
return True
311+
if instance.tags:
312+
for tag in instance.tags:
313+
if tag.get("Key") == self.AUTOSCALE_CUCKOO:
314+
return True
314315
return False
315316

316317
def _restore(self, label):

0 commit comments

Comments
 (0)