diff --git a/src/hostinfo/yp.py b/src/hostinfo/yp.py index df0a21bfc6da5b87c7bbb74291bd8f7b6569c2a1..08fa695cd2642c39e6c57d0e040080e481080c16 100755 --- a/src/hostinfo/yp.py +++ b/src/hostinfo/yp.py @@ -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