From c90f3a090cfddeeca975eb93be5e7122e3ba71ef Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Tue, 21 Mar 2017 05:23:53 +0000 Subject: [PATCH] Switch RootHelperProcess from select.poll to select.select The new eventlet 0.20.x that the gate was recently bumped to [1] removed select.poll [2]. Instead, we should use select.select that is both supported by eventlet as well as available on all platforms. [1] I534b8d7d6c2fa00c1fa7d84b3438e6e2b2fcad9e [2] http://eventlet.net/doc/changelog.html#id2 Change-Id: Ie649abf495e00e7e05de47520ed89bbcd28360db Closes-Bug: #1674557 (cherry picked from commit f48dbeda5c4f8f34fb0f56227254ea3b8f830005) --- neutron/tests/common/net_helpers.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/neutron/tests/common/net_helpers.py b/neutron/tests/common/net_helpers.py index 3c96a638548..f1b2b5418fe 100644 --- a/neutron/tests/common/net_helpers.py +++ b/neutron/tests/common/net_helpers.py @@ -267,12 +267,11 @@ class RootHelperProcess(subprocess.Popen): @staticmethod def _read_stream(stream, timeout): if timeout: - poller = select.poll() - poller.register(stream.fileno()) - poll_predicate = functools.partial(poller.poll, 1) - common_utils.wait_until_true(poll_predicate, timeout, 0.1, - RuntimeError( - 'No output in %.2f seconds' % timeout)) + poll_predicate = functools.partial( + select.select, [stream], [], [], 1) + common_utils.wait_until_true( + lambda: poll_predicate()[0], timeout, 0.1, + RuntimeError('No output in %.2f seconds' % timeout)) return stream.readline() def writeline(self, data):