def get_snapshot_id(ami): return utils.single(ami.block_device_mapping).snapshot_id
def get_snapshots(conn, instance): volume = utils.single(instance.block_device_mapping) print "Found volume with ID {}".format(volume.volume_id) my_snapshots = conn.get_all_snapshots([], "self", None, None) return my_snapshots