'Reset status of group snapshot'

def reset_group_snapshot_status(self, context, gsnapshot, status):

    check_policy(context, 'reset_group_snapshot_status')
    if (status not in c_fields.GroupSnapshotStatus.ALL):
        msg = (_('Group    snapshot    status:    %(status)s    is    invalid,    valid    statuses    are:    %(valid)s.') % {'status': status, 'valid': c_fields.GroupSnapshotStatus.ALL})
        raise exception.InvalidGroupSnapshotStatus(reason=msg)
    field = {'updated_at': timeutils.utcnow(), 'status': status}
    gsnapshot.update(field)
    gsnapshot.save()
