Commit c30ff5f7 authored by Xavier Thompson's avatar Xavier Thompson

slapformat: WIP: Fix IP addresses

parent e06180e0
...@@ -285,7 +285,8 @@ class Interface(object): ...@@ -285,7 +285,8 @@ class Interface(object):
return ipaddress.IPv4Network(cidr, strict=False) return ipaddress.IPv4Network(cidr, strict=False)
def getPartitionIPv4Addr(self, index): def getPartitionIPv4Addr(self, index):
return self.ipv4_network[index + 2] network = self.ipv4_network
return ipaddress.IPv4Interface((network[index + 2], network.prefixlen))
def getIPv6Network(self): def getIPv6Network(self):
try: try:
...@@ -308,11 +309,11 @@ class Interface(object): ...@@ -308,11 +309,11 @@ class Interface(object):
def getComputerIPv6Addr(self): def getComputerIPv6Addr(self):
network = self.ipv6_network network = self.ipv6_network
return ipaddress.ip_interface((network[1], network.prefixlen)) return ipaddress.IPv6Interface((network[1], network.prefixlen))
def getPartitionIPv6Addr(self, index): def getPartitionIPv6Addr(self, index):
network = self.ipv6_network network = self.ipv6_network
return ipaddress.ip_interface((network[index + 2], network.prefixlen)) return ipaddress.IPv6Interface((network[index + 2], network.prefixlen))
def getPartitionIPv6Range(self, index): def getPartitionIPv6Range(self, index):
network = self.ipv6_network network = self.ipv6_network
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment