def validate(value): if not utils.is_valid_ip(value): raise exception.InvalidIPAddress(address=value) return value
def _validate_ip_address(name, value): """Check if ip value is valid""" if not cutils.is_valid_ip(value): raise wsme.exc.ClientSideError(_( "Parameter '%s' must be an IP address." % name))