- Timestamp:
- May 16, 2012, 10:30:17 PM (13 years ago)
- Location:
- tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r10889 r10890 147 147 try: 148 148 for key in datadump['autogen_iface_keys']: 149 datadump[key]['autogen_ifbase'] = key.split('_')[1] 149 150 if datadump[key]['type'] in ['11a', '11b', '11g', 'wireless']: 150 151 datadump[key]['autogen_ifname'] = 'wlan%i' % wlan_count 151 152 wlan_count += 1 152 153 else: 153 datadump[key]['autogen_ifname'] = datadump[key][' interface'].split(':')[0]154 datadump[key]['autogen_ifname'] = datadump[key]['autogen_ifbase'] 154 155 except Exception as e: 155 156 print "# Error while processing interface %s" % key … … 445 446 if not datadump[iface_key].has_key('comment'): 446 447 datadump[iface_key]['comment'] = None 447 dhcp_out[ifname].append(" ## %( interface)s - %(comment)s\n" % datadump[iface_key])448 dhcp_out[ifname].append(" ## %(autogen_ifname)s - %(comment)s\n" % datadump[iface_key]) 448 449 449 450 (addr, mask) = datadump[iface_key]['ip'].split('/') … … 494 495 if not datadump[iface_key].has_key('comment'): 495 496 datadump[iface_key]['comment'] = None 496 output += "## %( interface)s - %(comment)s\n" % datadump[iface_key]497 output += "## %(autogen_ifname)s - %(comment)s\n" % datadump[iface_key] 497 498 498 499 if dhcp_type(datadump[iface_key]) != DHCP_SERVER: … … 507 508 datadump[iface_key]['autogen_dhcp_start'] = dhcp_part + "." + dhcp_start 508 509 datadump[iface_key]['autogen_dhcp_stop'] = dhcp_part + "." + dhcp_stop 509 output += "dhcp-range=%( interface)s,%(autogen_dhcp_start)s,%(autogen_dhcp_stop)s,%(autogen_netmask)s,24h\n\n" % datadump[iface_key]510 output += "dhcp-range=%(autogen_ifname)s,%(autogen_dhcp_start)s,%(autogen_dhcp_stop)s,%(autogen_netmask)s,24h\n\n" % datadump[iface_key] 510 511 511 512 return output … … 735 736 736 737 737 output += "wlans_%( interface)s='%(autogen_ifname)s'\n" % ifacedump738 output += "wlans_%(autogen_ifbase)s='%(autogen_ifname)s'\n" % ifacedump 738 739 output += ("create_args_%(autogen_ifname)s='wlanmode %(autogen_wlanmode)s mode " +\ 739 740 "%(mode)s ssid %(ssid)s %(autogen_extra)s channel %(channel)s'\n") % ifacedump … … 923 924 ifacedump = datadump[iface_key] 924 925 if ifacedump.has_key('ns_ip'): 925 output += " - %( interface)s || %(mode)s || %(ns_ip)s\n" % ifacedump926 output += " - %(autogen_ifname)s || %(mode)s || %(ns_ip)s\n" % ifacedump 926 927 927 928 return output … … 957 958 key_order = ( 958 959 ('comment', True), 959 ('interface', True),960 960 ('ip', True), 961 961 ('desc', True), … … 1148 1148 # Hacking to get proper DHCP IPs and hostnames 1149 1149 for iface_key in get_interface_keys(datadump): 1150 iface_name = datadump[iface_key]['interface'].replace(':',"-alias-")1150 iface_name = iface_key.replace('_','-') 1151 1151 (ip, cidr) = datadump[iface_key]['ip'].split('/') 1152 1152 try: … … 1537 1537 for iface_key in datadump['autogen_iface_keys']: 1538 1538 try: 1539 if datadump[iface_key]['interface'] not in iface_key:1540 raise ValueError("interface must be in the key name")1541 1539 # All our normal wireless cards are normal APs now 1542 1540 if datadump[iface_key]['type'] in ['11a', '11b', '11g', 'wireless']: -
tools/make-network-graph.py
r10038 r10890 52 52 53 53 link_data[addr] = 1 54 iface = datadump[iface_key][' interface']54 iface = datadump[iface_key]['autogen_ifname'] 55 55 nodename = datadump['nodename'] 56 56 print nodename, iface -
tools/make_network_kml.py
r10379 r10890 123 123 124 124 link_data[addr] = 1 125 iface = datadump[iface_key][' interface']125 iface = datadump[iface_key]['autogen_ifname'] 126 126 nodename = datadump['nodename'] 127 127 INTERVAL = 60 * 10
Note:
See TracChangeset
for help on using the changeset viewer.