[aws] ec2_vol_facts: only access volume tags when set (#46801)
(cherry picked from commit e744c83808
)
This commit is contained in:
parent
7690659f7f
commit
d82c5fb55f
2 changed files with 4 additions and 1 deletions
|
@ -0,0 +1,3 @@
|
|||
---
|
||||
bugfixes:
|
||||
- Only access EC2 volume tags when set
|
|
@ -92,7 +92,7 @@ def get_volume_info(volume, region):
|
|||
'status': attachment[0]["state"] if len(attachment) > 0 else None,
|
||||
'delete_on_termination': attachment[0]["delete_on_termination"] if len(attachment) > 0 else None
|
||||
},
|
||||
'tags': boto3_tag_list_to_ansible_dict(volume['tags'])
|
||||
'tags': boto3_tag_list_to_ansible_dict(volume['tags']) if "tags" in volume else None
|
||||
}
|
||||
|
||||
return volume_info
|
||||
|
|
Loading…
Reference in a new issue