From dfd6ee20bba581c38aea743add3d5ecb1859debb Mon Sep 17 00:00:00 2001 From: stamparm Date: Wed, 29 May 2013 15:26:11 +0200 Subject: [PATCH] Patch for an Issue #454 --- lib/core/common.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index f3bace66c..94d7bd82e 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -1072,7 +1072,7 @@ def parseTargetDirect(): if details.group('remote'): remote = True - conf.hostname = details.group('hostname') + conf.hostname = details.group('hostname').strip() conf.port = int(details.group('port')) else: conf.hostname = "localhost" @@ -1348,7 +1348,14 @@ def getLocalIP(): return retVal def getRemoteIP(): - return socket.gethostbyname(conf.hostname) + retVal = None + try: + retVal = socket.gethostbyname(conf.hostname) + except socket.gaierror: + errMsg = "address resolution problem " + errMsg += "occurred for hostname '%s'" % conf.hostname + singleTimeLogMessage(errMsg, logging.ERROR) + return retVal def getFileType(filePath): try: