- Timestamp:
- Mar 14, 2012, 2:13:19 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r10156 r10162 351 351 for iface_key in datadump['iface_keys']: 352 352 ifacedump = datadump[iface_key] 353 interface = ifacedump['interface'].split(':')[0] 354 # By default no special interface mapping 355 iface_map[interface] = interface 353 ifname = ifacedump['autogen_ifname'] 356 354 357 355 # Add interface IP to list 358 356 item = (ifacedump['ip'], ifacedump['desc']) 359 if addrs_list.has_key(i nterface):360 addrs_list[i nterface].append(item)357 if addrs_list.has_key(ifname): 358 addrs_list[ifname].append(item) 361 359 else: 362 addrs_list[i nterface] = [item]360 addrs_list[ifname] = [item] 363 361 364 362 # Alias only needs IP assignment for now, this might change if we … … 402 400 for iface,addrs in sorted(addrs_list.iteritems()): 403 401 for addr, comment in sorted(addrs,key=lambda x: parseaddr(x[0].split('/')[0])): 404 ifacedump['iface'] = iface405 402 output += "# %s || %s || %s\n" % (iface, addr, comment) 406 output += "ipv4_addrs_%s='%s'\n\n" % (iface _map[iface], " ".join([x[0] for x in addrs]))403 output += "ipv4_addrs_%s='%s'\n\n" % (iface, " ".join([x[0] for x in addrs])) 407 404 408 405 return output … … 424 421 wlan_count += 1 425 422 else: 426 datadump[key]['autogen_ifname'] = datadump[key]['interface'] 423 datadump[key]['autogen_ifname'] = datadump[key]['interface'].split(':')[0] 427 424 428 425 … … 972 969 if ssid.lower().startswith(prefix.lower()): 973 970 datadump[iface_key]['ssid'] = prefix + ssid[len(prefix)].upper() + ssid[len(prefix) + 1:] 971 if datadump[iface_key].has_key('ns_ip') and not datadump[iface_key].has_key('mode'): 972 datadump[iface_key]['mode'] = 'autogen-FIXME' 973 if not datadump[iface_key].has_key('desc'): 974 datadump[iface_key]['desc'] = 'autogen-FIXME' 974 975 store_yaml(datadump) 975 976 elif sys.argv[1] == "list":
Note:
See TracChangeset
for help on using the changeset viewer.