'Deletes a cgsnapshot.'

def delete_cgsnapshot(self, context, cgsnapshot, snapshots):

    model_update = {'status': cgsnapshot.status}
    snapshot_model_updates = []
    for snapshot in snapshots:
        snapshot_model_update = {'id': snapshot.id}
        try:
            self.delete_snapshot(snapshot)
            snapshot_model_update['status'] = fields.SnapshotStatus.DELETED
        except exception.SnapshotIsBusy:
            snapshot_model_update['status'] = fields.SnapshotStatus.AVAILABLE
        except Exception:
            snapshot_model_update['status'] = fields.SnapshotStatus.ERROR
            model_update['status'] = 'error'
        snapshot_model_updates.append(snapshot_model_update)
    return (model_update, snapshot_model_updates)
