- Timestamp:
- Dec 20, 2011, 7:50:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r9807 r9808 280 280 # - masterip is special as it needs to be assigned to at 281 281 # 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")] } 283 283 iface_map = {'lo0' : 'lo0'} 284 284 … … 299 299 300 300 # Add interface IP to list 301 item = (ifacedump['ip'], ifacedump['desc']) 301 302 if addrs_list.has_key(interface): 302 addrs_list[interface].append(i facedump['ip'])303 addrs_list[interface].append(item) 303 304 else: 304 addrs_list[interface] = [i facedump['ip']]305 addrs_list[interface] = [item] 305 306 306 307 # Alias only needs IP assignment for now, this might change if we … … 348 349 output += "\n" 349 350 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])) 351 354 352 355 return output
Note:
See TracChangeset
for help on using the changeset viewer.