diff --git a/etc/python/ip.py b/etc/python/ip.py index e5f36ae..e443194 100644 --- a/etc/python/ip.py +++ b/etc/python/ip.py @@ -34,9 +34,13 @@ def ips_of_metadata(clients, vlan='adm'): ``clients`` est une liste de ClientMetadata, qui peut ĂȘtre obtenue via metadata.query.by_groups (ou similaire) """ + if vlan not in ['adm', 'adh']: + raise NotImplementedError('Seul adm et adh sont supportĂ©s') out = [] for client in clients: 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): # if res[0] == socket.AF_INET6: # suffix = '/128'