Changeset 14053 in genesis for tools/gformat.py
- Timestamp:
- Feb 20, 2018, 2:54:34 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r14045 r14053 230 230 wlan_count += 1 231 231 else: 232 datadump[key]['autogen_if_dhcp'] = datadump[key]['autogen_ifbase']233 232 datadump[key]['autogen_ifname'] = '_'.join(key.split('_')[1:]) 234 233 if len(key.split('_')) > 2 and key.split('_')[2].isdigit(): 235 234 datadump[key]['autogen_vlan'] = key.split('_')[2] 236 235 datadump[key]['autogen_iface'] = '.'.join(key.split('_')[1:]) 236 datadump[key]['autogen_if_dhcp'] = datadump[key]['autogen_ifname'] 237 237 else: 238 238 datadump[key]['autogen_iface'] = '_'.join(key.split('_')[1:]) 239 datadump[key]['autogen_if_dhcp'] = datadump[key]['autogen_ifbase'] 240 print key,datadump[key]['autogen_iface'], datadump[key]['autogen_ifname'], datadump[key]['autogen_if_dhcp'] 239 241 240 242 except Exception as exc: … … 549 551 for iface_key in get_interface_keys(datadump): 550 552 ifname = datadump[iface_key]['autogen_ifbase'] 551 groupif = ifname if not datadump[iface_key]['autogen_vlan'] else iface_key553 groupif = datadump[iface_key]['autogen_if_dhcp'] 552 554 if not datadump[iface_key].has_key('comment'): 553 555 datadump[iface_key]['comment'] = None … … 610 612 # Output the blocks in groups 611 613 for ifname,value in sorted(dhcp_out.iteritems()): 612 if len(value) > 2: 613 output += ("shared-network %s {\n" % ifname) + indent(''.join(value), 2) + '\n}\n\n' 614 else: 615 output += ''.join(value) + "\n\n" 614 output += ("shared-network %s {\n" % ifname) + indent(''.join(value), 2).rstrip() + '\n}\n\n' 616 615 return output 617 616
Note:
See TracChangeset
for help on using the changeset viewer.