Beispiel #1
0
 def _build_ipv6(ips_v6):
     if not ips_v6:
         raise ib_ex.HostRecordNotPresent()
     ip = ips_v6[0]['ipv6addr']
     if not ib_utils.is_valid_ip(ip):
         raise ib_ex.InfobloxInvalidIp(ip=ip)
     return [IPv6.from_dict(ip_addr) for ip_addr in ips_v6]
Beispiel #2
0
 def test_is_invalid_ip(self):
     ips = ('192.data.0.1',
            'text',
            None,
            '192.168.159.658')
     for ip in ips:
         self.assertEqual(False, utils.is_valid_ip(ip))
Beispiel #3
0
 def _build_ipv6(ips_v6):
     if not ips_v6:
         raise ib_ex.HostRecordNotPresent()
     ip = ips_v6[0]['ipv6addr']
     if not ib_utils.is_valid_ip(ip):
         raise ib_ex.InfobloxInvalidIp(ip=ip)
     return [IPv6.from_dict(ip_addr) for ip_addr in ips_v6]
Beispiel #4
0
 def test_is_valid_ip(self):
     ips = ('192.168.0.1',
            '8.8.8.8',
            'fffe::1')
     for ip in ips:
         self.assertEqual(True, utils.is_valid_ip(ip))