You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by jr...@apache.org on 2014/09/09 21:28:30 UTC
svn commit: r1623871 - /qpid/trunk/qpid/tools/src/py/qpid-route
Author: jross
Date: Tue Sep 9 19:28:29 2014
New Revision: 1623871
URL: http://svn.apache.org/r1623871
Log:
QPID-6007: Test if hostname is valid; if not, default to trying localhost; this is a patch from Ernie Allen
Modified:
qpid/trunk/qpid/tools/src/py/qpid-route
Modified: qpid/trunk/qpid/tools/src/py/qpid-route
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/tools/src/py/qpid-route?rev=1623871&r1=1623870&r2=1623871&view=diff
==============================================================================
--- qpid/trunk/qpid/tools/src/py/qpid-route (original)
+++ qpid/trunk/qpid/tools/src/py/qpid-route Tue Sep 9 19:28:29 2014
@@ -509,7 +509,11 @@ def main(argv=None):
return(-1)
if nargs == 2:
- localBroker = socket.gethostname()
+ try:
+ socket.gethostbyname(socket.gethostname())
+ localBroker = socket.gethostname()
+ except socket.gaierror:
+ localBroker = "localhost"
else:
if config._srclocal:
localBroker = args[3]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org