
Bon, ca fait un peu gros hack, mais je n'ai pas d'autre idee darcs-hash:20080812131307-ddb99-3acaf00c04a8e2635dc999813efe58fa3dcb0d6b.gz
21 lines
482 B
Python
21 lines
482 B
Python
# -*- mode: python; coding: utf-8 -*-
|
|
#
|
|
# Recuperation des addresses ip des serveurs
|
|
|
|
import socket
|
|
|
|
def pubipof(hostname):
|
|
try:
|
|
return socket.gethostbyname(hostname + ".crans.org")
|
|
except:
|
|
# Peut-etre un serveur de la ferme ?
|
|
return socket.gethostbyname(hostname + ".ferme.crans.org")
|
|
|
|
def admipof(hostname):
|
|
return socket.gethostbyname(hostname + ".adm.crans.org")
|
|
|
|
def pubip():
|
|
return pubipof(hostname)
|
|
|
|
def admip():
|
|
return admipof(hostname)
|