ips_of_metadata: gestion vlan adm ET adh
This commit is contained in:
parent
0baa302692
commit
d8c2414b4d
1 changed files with 4 additions and 0 deletions
|
@ -34,9 +34,13 @@ def ips_of_metadata(clients, vlan='adm'):
|
||||||
``clients`` est une liste de ClientMetadata, qui peut être obtenue via
|
``clients`` est une liste de ClientMetadata, qui peut être obtenue via
|
||||||
metadata.query.by_groups (ou similaire)
|
metadata.query.by_groups (ou similaire)
|
||||||
"""
|
"""
|
||||||
|
if vlan not in ['adm', 'adh']:
|
||||||
|
raise NotImplementedError('Seul adm et adh sont supportés')
|
||||||
out = []
|
out = []
|
||||||
for client in clients:
|
for client in clients:
|
||||||
host = client.hostname
|
host = client.hostname
|
||||||
|
if vlan == 'adh':
|
||||||
|
host = host.split('.', 1)[0] + '.crans.org'
|
||||||
for res in socket.getaddrinfo(host, None, socket.AF_UNSPEC, socket.SOCK_STREAM):
|
for res in socket.getaddrinfo(host, None, socket.AF_UNSPEC, socket.SOCK_STREAM):
|
||||||
# if res[0] == socket.AF_INET6:
|
# if res[0] == socket.AF_INET6:
|
||||||
# suffix = '/128'
|
# suffix = '/128'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue