[asterisk-commits] testsuite: Handle when AMIFactory does not support reconnect... (testsuite[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Nov 2 06:23:01 CST 2015


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

Change subject: testsuite: Handle when AMIFactory does not support reconnections.
......................................................................


testsuite: Handle when AMIFactory does not support reconnections.

The ability to execute against a remote testsuite was added to
testsuite in commit c27a47740684042f95576f18f1c293188b04f257. This
uses the reconnectable AMIFactory but does not make it optional.

This change tweaks it so it is optional.

ASTERISK-25515 #close

Change-Id: Iec5f7de575ac0f49d8d2b7c9bc8abfcbff1b8a45
---
M lib/python/asterisk/test_case.py
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  Anonymous Coward #1000019: Verified
  Matt Jordan: Looks good to me, approved



diff --git a/lib/python/asterisk/test_case.py b/lib/python/asterisk/test_case.py
index ce06b9e..f123826 100644
--- a/lib/python/asterisk/test_case.py
+++ b/lib/python/asterisk/test_case.py
@@ -302,8 +302,11 @@
 
             self.ami.append(None)
             LOGGER.info("Creating AMIFactory %d to %s" % ((i + 1), host))
-            ami_factory = manager.AMIFactory(actual_user, actual_secret, i,
+            try:
+                ami_factory = manager.AMIFactory(actual_user, actual_secret, i,
                                              on_reconnect=on_reconnect)
+            except:
+                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/1545
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Iec5f7de575ac0f49d8d2b7c9bc8abfcbff1b8a45
Gerrit-PatchSet: 1
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>



More information about the asterisk-commits mailing list