'Reset status of generic group'

@wrap_check_policy
def reset_status(self, context, group, status):

    if (status not in c_fields.GroupStatus.ALL):
        msg = (_('Group    status:    %(status)s    is    invalid,    valid    status    are:    %(valid)s.') % {'status': status, 'valid': c_fields.GroupStatus.ALL})
        raise exception.InvalidGroupStatus(reason=msg)
    field = {'updated_at': timeutils.utcnow(), 'status': status}
    group.update(field)
    group.save()
