[crans_utils] ip_of_mid: mid spéciaux
This commit is contained in:
parent
96705403a2
commit
68fd355dad
1 changed files with 6 additions and 0 deletions
|
@ -42,6 +42,12 @@ def ip_of_mid(mid):
|
|||
else:
|
||||
raise ValueError("Mid dans aucune plage: %d" % mid)
|
||||
|
||||
if net == 'special':
|
||||
try:
|
||||
return netaddr.IPAddress(config.mid_machines_speciales[mid])
|
||||
except KeyError:
|
||||
return ValueError(u"Machine speciale inconnue: %d" % mid)
|
||||
|
||||
return netaddr.IPAddress(netaddr.IPNetwork(config.NETs[net][0]).first + mid - plage[0])
|
||||
|
||||
def strip_accents(a):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue