[Asterisk-code-review] ari.py: Fallback to WebSocketClientFactory creation with no ... (testsuite[master])

Matt Jordan asteriskteam at digium.com
Sat May 14 22:34:56 CDT 2016


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/2838

Change subject: ari.py: Fallback to WebSocketClientFactory creation with no debug options
......................................................................

ari.py: Fallback to WebSocketClientFactory creation with no debug options

With at least autobahn version 0.14.0, the 'debug' and 'debugCodePaths'
options are not supported. This patch makes it so that if a TypeError is
thrown during initialization of the WebSocketClientFactory with those
parameters, we try again with no debug options.

Change-Id: Ib60416a6dd6c065d7c5e1653f84046efbf2a62d4
---
M lib/python/asterisk/ari.py
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/38/2838/1

diff --git a/lib/python/asterisk/ari.py b/lib/python/asterisk/ari.py
index 064f5d5..6241f13 100644
--- a/lib/python/asterisk/ari.py
+++ b/lib/python/asterisk/ari.py
@@ -336,8 +336,11 @@
         if subscribe_all:
             url += '&subscribeAll=true'
         LOGGER.info("WebSocketClientFactory(url=%s)", url)
-        WebSocketClientFactory.__init__(self, url, debug=True,
-                                        protocols=['ari'], debugCodePaths=True)
+        try:
+            WebSocketClientFactory.__init__(self, url, debug=True,
+                                            protocols=['ari'], debugCodePaths=True)
+        except TypeError:
+            WebSocketClientFactory.__init__(self, url, protocols=['ari'])
         self.timeout_secs = timeout_secs
         self.attempts = 0
         self.start = None

-- 
To view, visit https://gerrit.asterisk.org/2838
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib60416a6dd6c065d7c5e1653f84046efbf2a62d4
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>



More information about the asterisk-code-review mailing list