Commit 297e8269 authored by Anders Blomdell's avatar Anders Blomdell
Browse files

Only emit hosts with pxeboot values for pxeboot dhcp

parent a35ea2a3
......@@ -181,7 +181,7 @@ def generate(tree, options):
served_networks = map(lambda d:, d._parent)),
result += emit_hosts(tree, options, served_networks,
pxeboot=(pxeboot != 'no'))
return str(result)
def emit_interface(tree, options, interface):
......@@ -264,6 +264,8 @@ def emit_hosts(tree, options, networks, pxeboot=False):
ethernet = ip.ethernet[0:]
if not ethernet:
if pxeboot == 'only' and not bool(ip._pxeboot_):
if ethernet.lower() != ethernet:
raise util.HostinfoException('%s not lower-case' % ethernet)
if ip.never[0]:
......@@ -318,7 +320,7 @@ def emit_hosts(tree, options, networks, pxeboot=False):
address=', '.join(
map(util.address, ip)))))
if pxeboot:
if pxeboot != 'no':
for i in ip:
for p in i._pxeboot_:
result += " " + p.value[0]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment