Changeset 13734 in genesis


Ignore:
Timestamp:
Jan 18, 2017, 10:41:57 PM (8 years ago)
Author:
rick
Message:

Keep equal interfaces together, more easy debugging

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r13733 r13734  
    529529    return '\n'.join(map(lambda x: ' ' * count + x, text.split('\n')))
    530530
     531  # Process DHCP blocks
    531532  dhcp_out = defaultdict(list)
    532533  for iface_key in get_interface_keys(datadump):
     
    546547
    547548    if dhcp_type(datadump[iface_key]) != DHCP_SERVER:
    548       dhcp_out[iface_key].append(textwrap.dedent("""\
     549      dhcp_out[ifname].append(textwrap.dedent("""\
    549550        subnet %(autogen_subnet)s netmask %(autogen_netmask)s {
    550551          ### not autoritive
     
    562563      fixed = 5
    563564      for mac in datadump['no_portal']:
    564         dhcp_out[iface_key].append(textwrap.dedent("""\
     565        dhcp_out[ifname].append(textwrap.dedent("""\
    565566            host fixed-%(ifname)s-%(fixed)s {
    566567              hardware ethernet %(mac)s;
     
    570571      fixed += 1
    571572
    572     dhcp_out[iface_key].append(textwrap.dedent("""\
     573    dhcp_out[ifname].append(textwrap.dedent("""\
    573574      subnet %(autogen_subnet)s netmask %(autogen_netmask)s {
    574575        range %(autogen_dhcp_start)s %(autogen_dhcp_stop)s;
     
    578579      """ % datadump[iface_key]))
    579580
     581  # Output the blocks in groups
    580582  for ifname,value in sorted(dhcp_out.iteritems()):
    581583    if len(value) > 2:
Note: See TracChangeset for help on using the changeset viewer.