Changeset 10890 in genesis for tools


Ignore:
Timestamp:
May 16, 2012, 10:30:17 PM (13 years ago)
Author:
rick
Message:

interface: <iface>:<alias> is nu in de iface_<iface>_alias<alias>
gerepresenteerd.

Fixes beheer:ticket:221

Location:
tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r10889 r10890  
    147147    try:
    148148      for key in datadump['autogen_iface_keys']:
     149        datadump[key]['autogen_ifbase'] = key.split('_')[1]
    149150        if datadump[key]['type'] in ['11a', '11b', '11g', 'wireless']:
    150151          datadump[key]['autogen_ifname'] = 'wlan%i' % wlan_count
    151152          wlan_count += 1
    152153        else:
    153           datadump[key]['autogen_ifname'] = datadump[key]['interface'].split(':')[0]
     154          datadump[key]['autogen_ifname'] = datadump[key]['autogen_ifbase']
    154155    except Exception as e:
    155156      print "# Error while processing interface %s" % key
     
    445446    if not datadump[iface_key].has_key('comment'):
    446447      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])
    448449
    449450    (addr, mask) = datadump[iface_key]['ip'].split('/')
     
    494495    if not datadump[iface_key].has_key('comment'):
    495496      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]
    497498
    498499    if dhcp_type(datadump[iface_key]) != DHCP_SERVER:
     
    507508    datadump[iface_key]['autogen_dhcp_start'] = dhcp_part + "." + dhcp_start
    508509    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]
    510511
    511512  return output
     
    735736       
    736737
    737       output += "wlans_%(interface)s='%(autogen_ifname)s'\n" % ifacedump
     738      output += "wlans_%(autogen_ifbase)s='%(autogen_ifname)s'\n" % ifacedump
    738739      output += ("create_args_%(autogen_ifname)s='wlanmode %(autogen_wlanmode)s mode " +\
    739740        "%(mode)s ssid %(ssid)s %(autogen_extra)s channel %(channel)s'\n") % ifacedump
     
    923924    ifacedump = datadump[iface_key]
    924925    if ifacedump.has_key('ns_ip'):
    925       output += " - %(interface)s || %(mode)s || %(ns_ip)s\n" % ifacedump
     926      output += " - %(autogen_ifname)s || %(mode)s || %(ns_ip)s\n" % ifacedump
    926927
    927928  return output
     
    957958  key_order = (
    958959    ('comment', True),
    959     ('interface', True),
    960960    ('ip', True),
    961961    ('desc', True),
     
    11481148    # Hacking to get proper DHCP IPs and hostnames
    11491149    for iface_key in get_interface_keys(datadump):
    1150       iface_name = datadump[iface_key]['interface'].replace(':',"-alias-")
     1150      iface_name = iface_key.replace('_','-')
    11511151      (ip, cidr) = datadump[iface_key]['ip'].split('/')
    11521152      try:
     
    15371537          for iface_key in datadump['autogen_iface_keys']:
    15381538            try:
    1539               if datadump[iface_key]['interface'] not in iface_key:
    1540                 raise ValueError("interface must be in the key name")
    15411539              # All our normal wireless cards are normal APs now
    15421540              if datadump[iface_key]['type'] in ['11a', '11b', '11g', 'wireless']:
  • tools/make-network-graph.py

    r10038 r10890  
    5252
    5353          link_data[addr] = 1
    54           iface = datadump[iface_key]['interface']
     54          iface = datadump[iface_key]['autogen_ifname']
    5555          nodename = datadump['nodename']
    5656          print nodename, iface
  • tools/make_network_kml.py

    r10379 r10890  
    123123
    124124          link_data[addr] = 1
    125           iface = datadump[iface_key]['interface']
     125          iface = datadump[iface_key]['autogen_ifname']
    126126          nodename = datadump['nodename']
    127127          INTERVAL = 60 * 10
Note: See TracChangeset for help on using the changeset viewer.