Gestion de certains cas o il n'y a pas d'entre DNS associe une IP.

darcs-hash:20070320081019-68412-9f053de0db8bc30c0643aecbb2c7e2aff9115ad1.gz
This commit is contained in:
glondu 2007-03-20 09:10:19 +01:00
parent 1ae4bc4cd9
commit b1a6e8e0ca

View file

@ -181,8 +181,10 @@ Exemples :
for key,value in opts :
if key == '--ip-ext' :
# recherche de l'ip de la machine extérieur
try :
try:
ip_ext.append(socket.gethostbyaddr(value)[2][0])
except socket.herror:
ip_ext.append(value)
except socket.gaierror :
print "Hôte %s inconnu" % value
sys.exit(5)
@ -190,6 +192,8 @@ Exemples :
# recherche du nom d'hote
try :
ip_ext_nom.append(socket.gethostbyaddr(value)[0])
except socket.herror:
ip_ext_nom.append(ip_ext[-1])
except socket.gaierror :
ip_ext_nom.append(ip_ext[-1])
if len(ip_ext_nom)==1: