X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=make-secnet-sites;h=158f5b36c8229b170969fe966de4cb23d4c84731;hb=2daad77ec25127315fde68729434a598b139afa0;hp=1cc979b57e4c5c7ecb66ffcbee9edf19154541cd;hpb=92eddd582b64891d360ad7bbafdc1e228ee2037e;p=secnet.git diff --git a/make-secnet-sites b/make-secnet-sites index 1cc979b..158f5b3 100755 --- a/make-secnet-sites +++ b/make-secnet-sites @@ -46,8 +46,7 @@ no-suppress-args cd ~/secnet/sites-test/ execute ~/secnet/make-secnet-sites.py -u vpnheader groupfiles sites -This program is part of secnet. It relies on the "ipaddr" library from -Cendio Systems AB. +This program is part of secnet. """ @@ -62,7 +61,7 @@ import os import getopt import re -import ipaddr +import ipaddress # entry 0 is "near the executable", or maybe from PYTHONPATH=., # which we don't want to preempt @@ -148,7 +147,7 @@ def listof(subtype): class single_ipaddr (basetype): "An IP address" def __init__(self,w): - self.addr=ipaddr.IPAddress(w[1]) + self.addr=ipaddress.ip_address(w[1]) def __str__(self): return '"%s"'%self.addr @@ -157,7 +156,7 @@ class networks (basetype): def __init__(self,w): self.set=ipaddrset.IPAddressSet() for i in w[1:]: - x=ipaddr.IPNetwork(i,strict=True) + x=ipaddress.ip_network(i,strict=True) self.set.append([x]) def __str__(self): return ",".join(map((lambda n: '"%s"'%n), self.set.networks()))