'Deletes a group snapshot.'

@cinder_utils.trace
def delete_group_snapshot(self, context, group_snapshot, snapshots):

    if (not utils.is_group_a_cg_snapshot_type(group_snapshot)):
        raise NotImplementedError()
    client = self._login()
    snap_name_base = ('snapshot-' + group_snapshot.id)
    snapshot_model_updates = []
    for (i, snapshot) in enumerate(snapshots):
        snapshot_update = {'id': snapshot['id']}
        try:
            snap_name = ((snap_name_base + '-') + six.text_type(i))
            snap_info = client.getSnapshotByName(snap_name)
            client.deleteSnapshot(snap_info['id'])
            snapshot_update['status'] = fields.SnapshotStatus.DELETED
        except hpeexceptions.HTTPServerError as ex:
            in_use_msg = 'cannot    be    deleted    because    it    is    a    clone    point'
            if (in_use_msg in ex.get_description()):
                LOG.error('The    snapshot    cannot    be    deleted    because    it    is    a    clone    point.')
            snapshot_update['status'] = fields.SnapshotStatus.ERROR
        except Exception as ex:
            LOG.error('There    was    an    error    deleting    snapshot    %(id)s:    %(error)s.', {'id': snapshot['id'], 'error': six.text_type(ex)})
            snapshot_update['status'] = fields.SnapshotStatus.ERROR
        snapshot_model_updates.append(snapshot_update)
    self._logout(client)
    model_update = {'status': group_snapshot.status}
    return (model_update, snapshot_model_updates)
