Changeset 13421 in genesis


Ignore:
Timestamp:
Oct 3, 2015, 9:39:30 PM (7 years ago)
Author:
rick
Message:

Removing the shared-network definitions from the equation since no interface will have multiple DHCP pools.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r13420 r13421  
    516516    if not datadump[iface_key].has_key('comment'):
    517517      datadump[iface_key]['comment'] = None
    518     dhcp_out[ifname].append("  ## %(autogen_ifname)s - %(comment)s\n" % datadump[iface_key])
     518    dhcp_out[ifname].append("## %(autogen_ifname)s - %(comment)s\n" % datadump[iface_key])
    519519
    520520    (addr, mask) = datadump[iface_key]['ip'].split('/')
     
    523523    datadump[iface_key]['autogen_subnet'] = get_network(addr, mask)
    524524    if dhcp_type(datadump[iface_key]) != DHCP_SERVER:
    525       dhcp_out[ifname].append("  subnet %(autogen_subnet)s netmask %(autogen_netmask)s {\n    ### not autoritive\n  }\n" % \
     525      dhcp_out[ifname].append("subnet %(autogen_subnet)s netmask %(autogen_netmask)s {\n  ### not autoritive\n}\n" % \
    526526        datadump[iface_key])
    527527      continue
     
    537537      for mac in datadump['no_portal']:
    538538        dhcp_out[ifname].append("""\
    539    host fixed-%(ifname)s-%(fixed)s {
    540      hardware ethernet %(mac)s;
    541      fixed-address %(prefix)s.%(fixed)s;
    542    }
     539host fixed-%(ifname)s-%(fixed)s {
     540  hardware ethernet %(mac)s;
     541  fixed-address %(prefix)s.%(fixed)s;
     542}
    543543""" % { 'ifname' : ifname, 'mac' : mac, 'prefix': dhcp_part, 'fixed' : fixed })
    544544      fixed += 1
    545545
    546546    dhcp_out[ifname].append("""\
    547    subnet %(autogen_subnet)s netmask %(autogen_netmask)s {
    548      range %(autogen_dhcp_start)s %(autogen_dhcp_stop)s;
    549      option routers %(autogen_addr)s;
    550      option domain-name-servers %(autogen_addr)s;
    551    }
     547subnet %(autogen_subnet)s netmask %(autogen_netmask)s {
     548  range %(autogen_dhcp_start)s %(autogen_dhcp_stop)s;
     549  option routers %(autogen_addr)s;
     550  option domain-name-servers %(autogen_addr)s;
     551}
    552552""" % datadump[iface_key])
    553553
    554554  for ifname,value in dhcp_out.iteritems():
    555     output += ("shared-network %s {\n" % ifname) + ''.join(value)  + '}\n\n'
     555    output += ''.join(value) + '\n\n'
    556556  return output
    557557
Note: See TracChangeset for help on using the changeset viewer.