Beispiel #1
0
 def validate(value):
     if not utils.is_valid_ip(value):
         raise exception.InvalidIPAddress(address=value)
     return value
Beispiel #2
0
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))