[asterisk-dev] Change in testsuite[master]: stasis: set a channel variable on websocket disconnect error

Ashley Sanders (Code Review) asteriskteam at digium.com
Wed Apr 8 13:57:43 CDT 2015


Ashley Sanders has posted comments on this change.

Change subject: stasis: set a channel variable on websocket disconnect error
......................................................................


Patch Set 5:

(1 comment)

Gerrit ate this response in my previous draft. :/

https://gerrit.asterisk.org/#/c/18/5/tests/rest_api/applications/stasisstatus/ari_client.py
File tests/rest_api/applications/stasisstatus/ari_client.py:

Line 365:            if run is 0:
        :                 LOGGER.debug(msg + 'Tearing down active connections.')
        :                 self.__delete_all_channels()
        :                 reactor.callLater(2, wait_for_it, deferred, 1)
        :             elif run is 1:
        :                 if len(self.__channels) > 0:
        :                     msg += 'Waiting for channels to be destroyed.'
        :                     LOGGER.debug(msg)
        :                     reactor.callLater(2, wait_for_it, deferred, 1)
        :                 reactor.callLater(2, wait_for_it, deferred, 2)
        :             elif run is 2:
        :                 LOGGER.debug(msg + 'Disconnecting web socket.')
        :                 self.__ari = None
        :                 self.__factory = None
        :                 self.disconnect_websocket()
        :                 reactor.callLater(2, wait_for_it, deferred, 3)
        :             elif run is 3:
> This is another of those cases where I'm not 100% sure on this, but I think
Gerrit ate my response to you. I am quite dismayed.

You are right. I goofed.

The 'is' operator is used to test for identity, while the '==' operator is used for value equality.

>From the python docs:
- The operators <, >, ==, >=, <=, and != compare the values of two objects. The objects need not have the same type. If both are numbers, they are converted to a common type.

- The operators is and is not test for object identity: x is y is true if and only if x and y are the same object. x is not y yields the inverse truth value.

See also:
https://docs.python.org/3.5/reference/expressions.html#comparisons

https://docs.python.org/3.5/library/operator.html#mapping-operators-to-functions

http://stackoverflow.com/a/2988117


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I0f7dadfd429bd30e9f07a531f47884d8c923fc13
Gerrit-PatchSet: 5
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Owner: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-dev mailing list