From 424a73eb44319c2d1a2002a673a0de41f44ce785 Mon Sep 17 00:00:00 2001 From: micafer Date: Fri, 18 Oct 2019 08:26:58 +0200 Subject: [PATCH] Implements #929 --- IM/connectors/EC2.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/IM/connectors/EC2.py b/IM/connectors/EC2.py index 085d9d12a..836407634 100644 --- a/IM/connectors/EC2.py +++ b/IM/connectors/EC2.py @@ -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')