--- a/pvl/hosts/host.py Tue Mar 10 00:11:43 2015 +0200
+++ b/pvl/hosts/host.py Tue Mar 10 00:26:31 2015 +0200
@@ -1,5 +1,5 @@
import collections
-import ipaddr
+import ipaddress
import logging; log = logging.getLogger('pvl.hosts.host')
import pvl.dns
@@ -156,8 +156,8 @@
return cls(name,
domain = domain,
- ip4 = parse_ip(ip, ipaddr.IPv4Address),
- ip6 = parse_ip(ip6, ipaddr.IPv6Address),
+ ip4 = parse_ip(ip, ipaddress.IPv4Address),
+ ip6 = parse_ip(ip6, ipaddress.IPv6Address),
ethernet = parse_dict(ethernet, parse_ethernet),
owner = owner,
location = parse_location(location, domain),
@@ -183,8 +183,8 @@
"""
name - str
domain - str
- ip4 - primary ipaddr.IPv4Address
- ip6 - primary ipaddr.IPv6Address
+ ip4 - ipaddress.IPv4Address
+ ip6 - ipaddress.IPv6Address
ethernet - { index: ethernet }
alias - [ str ]: generate CNAMEs for given relative names
owner - str: LDAP uid
@@ -224,11 +224,11 @@
return self.ip4
else:
# sorts first
- return ipaddr.IPAddress(0)
+ return ipaddress.IPvAddress(0)
def addresses (self):
"""
- Yield (sublabel, ipaddr) records.
+ Yield (sublabel, ipaddress.IP*Address) records.
"""
if self.ip4: