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
f9533d81
Commit
f9533d81
authored
Feb 21, 2018
by
Anders Blomdell
Browse files
Add FQN for ipv6 domains
parent
bedc366a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hostinfo/yp.py
View file @
f9533d81
...
...
@@ -32,16 +32,22 @@ def ethers(tree):
result
=
""
host
=
{}
for
i
in
filter
(
lambda
i
:
i
.
ethernet
[
0
],
tree
.
_host_
.
_interface_
):
host
[
i
.
ethernet
[
0
]]
=
[
i
.
name
[
0
:]
]
host
[
i
.
ethernet
[
0
]]
=
set
(
[
i
.
name
[
0
:]
]
)
for
ip
in
filter
(
util
.
address
,
i
.
_ip_
):
fqn
=
util
.
fqn
(
tree
,
ip
)
if
fqn
:
host
[
i
.
ethernet
[
0
]].
append
(
fqn
[
0
:
-
1
])
host
[
i
.
ethernet
[
0
]].
add
(
fqn
[
0
:
-
1
])
pass
pass
for
ipv6
in
filter
(
util
.
address
,
i
.
_ipv6_
):
fqn
=
util
.
fqn
(
tree
,
ipv6
)
if
fqn
:
host
[
i
.
ethernet
[
0
]].
add
(
fqn
[
0
:
-
1
])
pass
pass
pass
for
k
in
sorted
(
host
,
cmp
=
util
.
by_mac
):
for
h
in
host
[
k
]:
for
h
in
sorted
(
host
[
k
]
)
:
result
+=
"%-15s %s
\n
"
%
(
k
,
h
)
return
result
...
...
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