'Delete group snapshot.'

@huawei_utils.check_whether_operate_consistency_group
def delete_group_snapshot(self, context, group_snapshot, snapshots):

    LOG.info('Delete    group    snapshot    %(snap_id)s    for    group:    %(group_id)s', {'snap_id': group_snapshot.id, 'group_id': group_snapshot.group_id})
    model_update = {}
    snapshots_model_update = []
    model_update['status'] = fields.GroupSnapshotStatus.DELETED
    for snapshot in snapshots:
        try:
            self.delete_snapshot(snapshot)
            snapshot_model = {'id': snapshot.id, 'status': fields.SnapshotStatus.DELETED}
            snapshots_model_update.append(snapshot_model)
        except Exception:
            with excutils.save_and_reraise_exception():
                LOG.error('Delete    group    snapshot    failed.    Group    snapshot    id:    %s', group_snapshot.id)
    return (model_update, snapshots_model_update)
