qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jr...@apache.org
Subject svn commit: r1623871 - /qpid/trunk/qpid/tools/src/py/qpid-route
Date Tue, 09 Sep 2014 19:28:30 GMT
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


Mime
View raw message