- Timestamp:
- Feb 14, 2012, 10:57:30 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r9957 r9958 621 621 622 622 # WL uses an /29 to configure an interface. IP's are ordered like this: 623 # MasterA (.1) -- DeviceA (.2) <<>> DeviceB (. 5) --- SlaveB (.6)623 # MasterA (.1) -- DeviceA (.2) <<>> DeviceB (.3) --- SlaveB (.4) 624 624 625 625 sn = lambda x: re.sub(r'(?i)^cnode','',x) … … 627 627 # Automatic naming convention of interlinks namely 2 + remote.lower() 628 628 for (key,value) in pool.iteritems(): 629 # Make sure they are sorted from low-ip to high-ip 630 value = sorted(value, key=lambda x: parseaddr(x[2])) 631 629 632 if len(value) == 1: 630 633 (iface_name, fqdn, ip) = value[0] … … 640 643 (b_iface_name, b_fqdn, b_ip) = value[1] 641 644 wleiden_zone["2%s.%s" % (b_fqdn,a_fqdn)] = a_ip 642 # Slave interface643 645 wleiden_zone["2%s.%s" % (a_fqdn,b_fqdn)] = b_ip 644 646 … … 646 648 if 'cnode' in a_fqdn.lower() and 'cnode' in b_fqdn.lower(): 647 649 wleiden_zone["d-at-%s.%s" % (a_iface_name, a_fqdn)] = showaddr(parseaddr(a_ip) + 1) 648 wleiden_zone["d-at-%s.%s" % (b_iface_name, b_fqdn)] = showaddr(parseaddr( a_ip) - 1)650 wleiden_zone["d-at-%s.%s" % (b_iface_name, b_fqdn)] = showaddr(parseaddr(b_ip) - 1) 649 651 wleiden_cname["d-at-%s.%s" % (a_iface_name,sn(a_fqdn))] = "d-at-%s.%s" % (a_iface_name, a_fqdn) 650 652 wleiden_cname["d-at-%s.%s" % (b_iface_name,sn(b_fqdn))] = "d-at-%s.%s" % (b_iface_name, b_fqdn)
Note:
See TracChangeset
for help on using the changeset viewer.