Changeset 13434 in genesis


Ignore:
Timestamp:
Oct 8, 2015, 8:32:11 PM (9 years ago)
Author:
rick
Message:

Whoops reverting r13421, turned out this is required, since we have aliases IPs
on non-autoritive subnets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/gformat.py

    r13421 r13434  
    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 }
     539   host 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 }
     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   }
    552552""" % datadump[iface_key])
    553553
    554554  for ifname,value in dhcp_out.iteritems():
    555     output += ''.join(value) + '\n\n'
     555    output += ("shared-network %s {\n" % ifname) + ''.join(value)  + '}\n\n'
    556556  return output
    557557
Note: See TracChangeset for help on using the changeset viewer.