[Asterisk-code-review] test case: Fallback to non-reconnecting AMIFactory (testsuite[master])

Matt Jordan asteriskteam at digium.com
Mon Nov 2 06:21:01 CST 2015


Matt Jordan has uploaded a new change for review.

  https://gerrit.asterisk.org/1546

Change subject: test_case: Fallback to non-reconnecting AMIFactory
......................................................................

test_case: Fallback to non-reconnecting AMIFactory

When c27a4774 was merged, it accidentally removed the fallback to a
non-reconnecting AMIFactory if the reconnecting version is not supported
by the underlying starpy library. This patch adds that back in.

ASTERISK-25515 #close

Change-Id: I81a79953ed7e2ed67195b2ab4c2ccf9e29f6d9a5
---
M lib/python/asterisk/test_case.py
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/46/1546/1

diff --git a/lib/python/asterisk/test_case.py b/lib/python/asterisk/test_case.py
index ce06b9e..11a14a7 100644
--- a/lib/python/asterisk/test_case.py
+++ b/lib/python/asterisk/test_case.py
@@ -302,8 +302,12 @@
 
             self.ami.append(None)
             LOGGER.info("Creating AMIFactory %d to %s" % ((i + 1), host))
-            ami_factory = manager.AMIFactory(actual_user, actual_secret, i,
-                                             on_reconnect=on_reconnect)
+            try:
+                ami_factory = manager.AMIFactory(actual_user, actual_secret, i,
+                                                 on_reconnect=on_reconnect)
+            except:
+                # Try without reconnects
+                ami_factory = manager.AMIFactory(actual_user, actual_secret, i)
             deferred = ami_factory.login(ip=host, port=actual_port)
             deferred.addCallbacks(self._ami_connect, self.ami_login_error)
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I81a79953ed7e2ed67195b2ab4c2ccf9e29f6d9a5
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