mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00:00
ec2_ami: Properly delete snapshots (#39606)
This commit is contained in:
committed by
Ryan Brown
parent
afdc2364f2
commit
910bc892c6
@@ -496,7 +496,7 @@ def deregister_image(module, connection):
|
||||
snapshots = []
|
||||
if 'BlockDeviceMappings' in image:
|
||||
for mapping in image.get('BlockDeviceMappings'):
|
||||
snapshot_id = mapping.get('SnapshotId')
|
||||
snapshot_id = mapping.get('Ebs', {}).get('SnapshotId')
|
||||
if snapshot_id is not None:
|
||||
snapshots.append(snapshot_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user