Skip to content

Commit

Permalink
Implements #929
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Oct 18, 2019
1 parent d95cc4b commit 424a73e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion IM/connectors/EC2.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,11 @@ def get_volumes(conn, vm):
if elem_id.startswith('snap-'):
snapshot_id = conn.get_all_snapshots([elem_id])[0].id
else:
raise Exception("Incorrect snapshot ID: %s" % elem_id)
snapshot = conn.get_all_snapshots(filters={'tag:Name': elem_id})
if snapshot:
snapshot_id = snapshot[0].id
else:
raise Exception("No snapshot found with name: %s" % elem_id)
else:
disk_size = vm.info.systems[0].getFeature("disk." + str(cont) + ".size").getValue('G')

Expand Down

0 comments on commit 424a73e

Please sign in to comment.