Changeset 9808 in genesis for tools


Ignore:
Timestamp:
Dec 20, 2011, 7:50:15 PM (13 years ago)
Author:
rick
Message:

Extra comments is proven usefull when debugging for errors...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r9807 r9808  
    280280  # - masterip is special as it needs to be assigned to at
    281281  #   least one interface, so if not used assign to lo0
    282   addrs_list = { 'lo0' : ["127.0.0.1/8", "172.31.255.1/32"] }
     282  addrs_list = { 'lo0' : [("127.0.0.1/8", "LocalHost"), ("172.31.255.1/32","Proxy IP")] }
    283283  iface_map = {'lo0' : 'lo0'}
    284284
     
    299299
    300300    # Add interface IP to list
     301    item = (ifacedump['ip'], ifacedump['desc'])
    301302    if addrs_list.has_key(interface):
    302       addrs_list[interface].append(ifacedump['ip'])
     303      addrs_list[interface].append(item)
    303304    else:
    304       addrs_list[interface] = [ifacedump['ip']]
     305      addrs_list[interface] = [item]
    305306
    306307    # Alias only needs IP assignment for now, this might change if we
     
    348349  output += "\n"
    349350  for iface,addrs in sorted(addrs_list.iteritems()):
    350     output += "ipv4_addrs_%s='%s'\n" % (iface_map[iface], " ".join(addrs))
     351    for addr,comment in addrs:
     352      output += "# %s || %s || %s\n" % (iface, addr, comment)
     353    output += "ipv4_addrs_%s='%s'\n\n" % (iface_map[iface], " ".join([x[0] for x in addrs]))
    351354
    352355  return output
Note: See TracChangeset for help on using the changeset viewer.