X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=system%2Futils.py;h=2d30edc6d4471bb6cea374142ce5daf97681f608;hb=df8006feda3e410f0ce2757ceb5e41ed8c5d8d63;hp=b246b1851c1c06fc42f42b9dac655a61127c55b3;hpb=19289924105600a78fc80ac0d6b96801c1f26756;p=tests.git diff --git a/system/utils.py b/system/utils.py index b246b18..2d30edc 100644 --- a/system/utils.py +++ b/system/utils.py @@ -130,6 +130,11 @@ def is_local (hostname): if hostname == "localhost": return True import socket - local_ip = socket.gethostbyname(socket.gethostname()) - remote_ip = socket.gethostbyname(hostname) - return local_ip==remote_ip + try: + local_ip = socket.gethostbyname(socket.gethostname()) + remote_ip = socket.gethostbyname(hostname) + return local_ip==remote_ip + except: + header("WARNING : something wrong in is_local with hostname=%s"%hostname) + return False +