[asterisk-commits] mjordan: testsuite/asterisk/trunk r3152 - /asterisk/trunk/lib/python/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Mar 26 16:32:55 CDT 2012


Author: mjordan
Date: Mon Mar 26 16:32:51 2012
New Revision: 3152

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3152
Log:
Make ami_login_error return a twisted Failure

Per the specification for deferds, an errback must either raise
an exception or return a twisted.python.failure.Failure instance.
Otherwise, the usual chain of callbacks is returned to.  This isn't
terribly useful when the error in question is a failure to connect
to AMI.  This should make the login error a bit more terminal when
something goes wrong during an AMI connection.

Modified:
    asterisk/trunk/lib/python/asterisk/TestCase.py

Modified: asterisk/trunk/lib/python/asterisk/TestCase.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/TestCase.py?view=diff&rev=3152&r1=3151&r2=3152
==============================================================================
--- asterisk/trunk/lib/python/asterisk/TestCase.py (original)
+++ asterisk/trunk/lib/python/asterisk/TestCase.py Mon Mar 26 16:32:51 2012
@@ -14,6 +14,7 @@
 import datetime
 import time
 from twisted.internet import reactor, defer
+from twisted.python import failure
 from starpy import manager, fastagi
 
 from asterisk import Asterisk
@@ -355,6 +356,7 @@
         """
         logger.error("Error logging into AMI")
         self.stop_reactor()
+        return failure.Failure()
 
     def ami_connect(self, ami):
         """




More information about the asterisk-commits mailing list