Changeset 13434 in genesis
- Timestamp:
- Oct 8, 2015, 8:32:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r13421 r13434 516 516 if not datadump[iface_key].has_key('comment'): 517 517 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]) 519 519 520 520 (addr, mask) = datadump[iface_key]['ip'].split('/') … … 523 523 datadump[iface_key]['autogen_subnet'] = get_network(addr, mask) 524 524 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" % \ 526 526 datadump[iface_key]) 527 527 continue … … 537 537 for mac in datadump['no_portal']: 538 538 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 } 543 543 """ % { 'ifname' : ifname, 'mac' : mac, 'prefix': dhcp_part, 'fixed' : fixed }) 544 544 fixed += 1 545 545 546 546 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 } 552 552 """ % datadump[iface_key]) 553 553 554 554 for ifname,value in dhcp_out.iteritems(): 555 output += ''.join(value) + '\n\n'555 output += ("shared-network %s {\n" % ifname) + ''.join(value) + '}\n\n' 556 556 return output 557 557
Note:
See TracChangeset
for help on using the changeset viewer.