def getLocalIP():
 retVal = None
 try:
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  s.connect((conf.hostname, conf.port))
  (retVal, _) = s.getsockname()
  s.close()
 except:
  debugMsg = 'there was an error in opening socket '
  debugMsg += ("connection toward '%s'" % conf.hostname)
  logger.debug(debugMsg)
 return retVal

def getLocalIP ( ) : retVal = None try : s = socket . socket ( socket . AF_INET , socket . SOCK_STREAM ) s . connect ( ( conf . hostname , conf . port ) ) ( retVal , _ ) = s . getsockname ( ) s . close ( ) except : debugMsg = 'there was an error in opening socket ' debugMsg += ( "connection toward '%s'" % conf . hostname ) logger . debug ( debugMsg ) return retVal
get local ip address .