mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix crash in boto_asg.get_instances if the requested attribute may be None
This commit is contained in:
parent
764d70af79
commit
03d7c6af3d
1 changed files with 2 additions and 1 deletions
|
@ -552,4 +552,5 @@ def get_instances(name, lifecycle_state="InService", health_status="Healthy", at
|
|||
instance_ids.append(i.instance_id)
|
||||
# get full instance info, so that we can return the attribute
|
||||
instances = ec2_conn.get_only_instances(instance_ids=instance_ids)
|
||||
return [getattr(instance, attribute).encode("ascii") for instance in instances]
|
||||
attributes = [getattr(instance, attribute) for instance in instances]
|
||||
return [attribute.encode("ascii") if attribute is not None else None for attribute in attributes]
|
||||
|
|
Loading…
Add table
Reference in a new issue