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:
parent
1ae4bc4cd9
commit
b1a6e8e0ca
1 changed files with 5 additions and 1 deletions
|
@ -181,8 +181,10 @@ Exemples :
|
||||||
for key,value in opts :
|
for key,value in opts :
|
||||||
if key == '--ip-ext' :
|
if key == '--ip-ext' :
|
||||||
# recherche de l'ip de la machine extérieur
|
# recherche de l'ip de la machine extérieur
|
||||||
try :
|
try:
|
||||||
ip_ext.append(socket.gethostbyaddr(value)[2][0])
|
ip_ext.append(socket.gethostbyaddr(value)[2][0])
|
||||||
|
except socket.herror:
|
||||||
|
ip_ext.append(value)
|
||||||
except socket.gaierror :
|
except socket.gaierror :
|
||||||
print "Hôte %s inconnu" % value
|
print "Hôte %s inconnu" % value
|
||||||
sys.exit(5)
|
sys.exit(5)
|
||||||
|
@ -190,6 +192,8 @@ Exemples :
|
||||||
# recherche du nom d'hote
|
# recherche du nom d'hote
|
||||||
try :
|
try :
|
||||||
ip_ext_nom.append(socket.gethostbyaddr(value)[0])
|
ip_ext_nom.append(socket.gethostbyaddr(value)[0])
|
||||||
|
except socket.herror:
|
||||||
|
ip_ext_nom.append(ip_ext[-1])
|
||||||
except socket.gaierror :
|
except socket.gaierror :
|
||||||
ip_ext_nom.append(ip_ext[-1])
|
ip_ext_nom.append(ip_ext[-1])
|
||||||
if len(ip_ext_nom)==1:
|
if len(ip_ext_nom)==1:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue