You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2014/10/10 14:58:57 UTC

svn commit: r1630873 - in /qpid/proton/branches/examples: proton-c/bindings/python/proton.py tests/python/proton_tests/url.py

Author: gsim
Date: Fri Oct 10 12:58:56 2014
New Revision: 1630873

URL: http://svn.apache.org/r1630873
Log:
PROTON-693: If the system doesn't have port definitions for amqp/amqps
use the default values of 5672/5671.
- Not all systems have /etc/service (or similar) files that define
  these ports, but our tests use them and the defaults are these
  strings.

Modified:
    qpid/proton/branches/examples/proton-c/bindings/python/proton.py
    qpid/proton/branches/examples/tests/python/proton_tests/url.py

Modified: qpid/proton/branches/examples/proton-c/bindings/python/proton.py
URL: http://svn.apache.org/viewvc/qpid/proton/branches/examples/proton-c/bindings/python/proton.py?rev=1630873&r1=1630872&r2=1630873&view=diff
==============================================================================
--- qpid/proton/branches/examples/proton-c/bindings/python/proton.py (original)
+++ qpid/proton/branches/examples/proton-c/bindings/python/proton.py Fri Oct 10 12:58:56 2014
@@ -3716,7 +3716,11 @@ class Url(object):
         try:
           return socket.getservbyname(value)
         except socket.error:
-          raise ValueError("Not a valid port number or service name: '%s'" % value)
+          # Not every system has amqp/amqps defined as a service
+          if value == Url.AMQPS:  return 5671
+          elif value == Url.AMQP: return 5672
+          else:
+            raise ValueError("Not a valid port number or service name: '%s'" % value)
 
   def __init__(self, url=None, **kwargs):
     """

Modified: qpid/proton/branches/examples/tests/python/proton_tests/url.py
URL: http://svn.apache.org/viewvc/qpid/proton/branches/examples/tests/python/proton_tests/url.py?rev=1630873&r1=1630872&r2=1630873&view=diff
==============================================================================
--- qpid/proton/branches/examples/tests/python/proton_tests/url.py (original)
+++ qpid/proton/branches/examples/tests/python/proton_tests/url.py Fri Oct 10 12:58:56 2014
@@ -106,13 +106,6 @@ class UrlTest(common.Test):
             self.assertEqual(str(Url(s).defaults()), full)
 
     def testAmqps(self):
-        """Some old platforms don't recognize the amqps service name, this test is a no-op
-        if that is the case otherwise verify we treat amqps correctly."""
-        try:
-            Url.Port('amqps')
-        except ValueError:
-            print "skipping: service 'amqps' not recognized on this platform"
-            return
         # Scheme defaults
         self.assertEqual(str(Url("me:secret@myhost/foobar").defaults()),
                          "amqp://me:secret@myhost:amqp/foobar")



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org