Skip to content
Snippets Groups Projects
Commit a35ea2a3 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Make it possible to add extra pxeboot values (for pc.lu windows support)

parent 23509adc
No related branches found
No related tags found
No related merge requests found
......@@ -180,8 +180,8 @@ def generate(tree, options):
pass
served_networks = map(lambda d: util.network(get_subnet(tree, d._parent)),
dhcp)
if pxeboot == 'no':
result += emit_hosts(tree, options, served_networks)
result += emit_hosts(tree, options, served_networks,
pxeboot=(pxeboot != 'no'))
return str(result)
def emit_interface(tree, options, interface):
......@@ -253,7 +253,7 @@ def emit_subnet_info(subnet):
pass
return result
def emit_hosts(tree, options, networks):
def emit_hosts(tree, options, networks, pxeboot=False):
result = util.StringArray()
def match(a):
return filter(lambda n: a in n, networks)
......@@ -311,12 +311,21 @@ def emit_hosts(tree, options, networks):
| host %(id)s {
| hardware ethernet %(ethernet)s;
| fixed-address %(address)s;
| option host-name "%(name)s";
| }""" % dict(id='%s_%s' % (name, ether.replace(':','')),
| option host-name "%(name)s"; """ %
dict(id='%s_%s' % (name, ether.replace(':','')),
name=name,
ethernet=ether,
address=', '.join(map(str,
address=', '.join(
map(str,
map(util.address, ip)))))
if pxeboot:
for i in ip:
for p in i._pxeboot_:
result += " " + p.value[0]
pass
pass
pass
result += " }"
pass
result += "}"
pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment