[Asterisk-code-review] sipp, test suite utils: Default media port to an unused port (testsuite[master])
Corey Farrell
asteriskteam at digium.com
Wed Apr 18 17:48:45 CDT 2018
Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/8691 )
Change subject: sipp, test_suite_utils: Default media port to an unused port
......................................................................
Patch Set 5:
(3 comments)
https://gerrit.asterisk.org/#/c/8691/5/lib/python/asterisk/utils_socket.py
File lib/python/asterisk/utils_socket.py:
https://gerrit.asterisk.org/#/c/8691/5/lib/python/asterisk/utils_socket.py@222
PS5, Line 222: empty list.
> Kinda. If passed a port and that port is not available or any of its spanne
Maybe I'm not completely understanding but I think it would make more sense to always throw an exception if the requested ports cannot be acquired. I guess the question is what will callers do if they receive an empty list? It seems like the normal case would be for this to be a fatal error.
https://gerrit.asterisk.org/#/c/8691/5/lib/python/asterisk/utils_socket.py@233
PS5, Line 233: ports = self.get_avail(host, range(port[0] + 1, port[0] + span +
> Same reasoning as the other one (above). I was thinking span would represen
I think replacing the argument/default 'span=0' with 'count=1' would make more sense, where 'count' would be the total number of ports required (count < 1 would be invalid).
https://gerrit.asterisk.org/#/c/8691/5/lib/python/asterisk/utils_socket.py@238
PS5, Line 238: PortError(socktype, family, attempts)
> If searching for an available port and its 'spans' and nothing available ca
Yes I think we should throw an exception, sorry for the lack of python knowledge but I don't think the code will actually throw the exception as is, it will just create it the exception object?
--
To view, visit https://gerrit.asterisk.org/8691
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3da461123afc30e1f5ca12e65d289eaa42d6de00
Gerrit-Change-Number: 8691
Gerrit-PatchSet: 5
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Benjamin Keith Ford <bford at digium.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Wed, 18 Apr 2018 22:48:45 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180418/7eebe80a/attachment-0001.html>
More information about the asterisk-code-review
mailing list