Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Anders Blomdell
hostinfo
Commits
297e8269
Commit
297e8269
authored
Mar 23, 2018
by
Anders Blomdell
Browse files
Only emit hosts with pxeboot values for pxeboot dhcp
parent
a35ea2a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hostinfo/dhcpd.py
View file @
297e8269
...
...
@@ -181,7 +181,7 @@ def generate(tree, options):
served_networks
=
map
(
lambda
d
:
util
.
network
(
get_subnet
(
tree
,
d
.
_parent
)),
dhcp
)
result
+=
emit_hosts
(
tree
,
options
,
served_networks
,
pxeboot
=
(
pxeboot
!=
'no'
)
)
pxeboot
=
pxeboot
)
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
:
continue
if
pxeboot
==
'only'
and
not
bool
(
ip
.
_pxeboot_
):
continue
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
(
str
,
map
(
util
.
address
,
ip
)))))
if
pxeboot
:
if
pxeboot
!=
'no'
:
for
i
in
ip
:
for
p
in
i
.
_pxeboot_
:
result
+=
" "
+
p
.
value
[
0
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment