Beispiel #1
0
    def verify_value(self, value):
        if len(value.strip()) == 0:
            raise Invalid("Cannot accept zero-length value")
        elif all(c in DNSRecordValidator.valid_characters for c in value):
            is_ip, addr = cast_ip4addr(value)
            if not is_ip: is_ip, addr = cast_ip6addr(value)

            if is_ip: raise Invalid("Cannot have IP address in value of %s" % self.__class__.__name__)
        else:
            raise Invalid("Invalid characters in value of %s" % self.__class__.__name__)
Beispiel #2
0
    def verify_value(self, value):
        if len(value.strip()) == 0:
            raise Invalid("Cannot accept zero-length value")
        elif all(c in DNSRecordValidator.valid_characters for c in value):
            is_ip, addr = cast_ip4addr(value)
            if not is_ip: is_ip, addr = cast_ip6addr(value)

            if is_ip:
                raise Invalid("Cannot have IP address in value of %s" %
                              self.__class__.__name__)
        else:
            raise Invalid("Invalid characters in value of %s" %
                          self.__class__.__name__)
Beispiel #3
0
 def verify_value(self, value):
     res, ip = cast_ip6addr(value)
     if not res or ip.version != 6:
         raise Invalid("Invalid IPv6 Address for %s" %
                       self.__class__.__name__)
Beispiel #4
0
 def verify_value(self, value):
     res, ip = cast_ip6addr(value)
     if not res or ip.version != 6:
         raise Invalid("Invalid IPv6 Address for %s" % self.__class__.__name__)