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

Anonymous Coward asteriskteam at digium.com
Tue May 17 05:25:39 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

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(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



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: merged
Gerrit-Change-Id: Ib60416a6dd6c065d7c5e1653f84046efbf2a62d4
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list