Handle PEP479 issues on ha

Similar to how PEP479 was handled on config[1].

Instances of "raise StopIteration" were changed to
a plain 'return' statement in order to avoid breaking
the existing logic.

CentOS 7 tests:
PASS: Build & install
PASS: Successful Bootstrap

Debian Bullseye tests:
PASS: Build & install
PASS: Successful Bootstrap

[1] https://review.opendev.org/c/starlingx/config/+/825447

Story: 2009101
Task: 44513

Signed-off-by: Matheus Machado Guilhermino <Matheus.MachadoGuilhermino@windriver.com>
Change-Id: Ibe4717e64fcee159c1bc4a17acf623adbfae3908
This commit is contained in:
Matheus Machado Guilhermino 2022-02-16 01:26:04 -03:00
parent e7ed35ae4a
commit 6ffad90d16
4 changed files with 7 additions and 7 deletions

View File

@ -500,7 +500,7 @@ class MulticallProxyWaiter(object):
def __iter__(self):
"""Return a result until we get a reply with an 'ending" flag"""
if self._done:
raise StopIteration
return
while True:
try:
data = self._dataqueue.get(timeout=self._timeout)
@ -513,7 +513,7 @@ class MulticallProxyWaiter(object):
self.done()
if self._got_ending:
self.done()
raise StopIteration
return
if isinstance(result, Exception):
self.done()
raise result
@ -556,7 +556,7 @@ class MulticallWaiter(object):
def __iter__(self):
"""Return a result until we get a 'None' response from consumer"""
if self._done:
raise StopIteration
return
while True:
try:
next(self._iterator)
@ -565,7 +565,7 @@ class MulticallWaiter(object):
self.done()
if self._got_ending:
self.done()
raise StopIteration
return
result = self._result
if isinstance(result, Exception):
self.done()

View File

@ -665,7 +665,7 @@ class Connection(object):
for iteration in itertools.count(0):
if limit and iteration >= limit:
raise StopIteration
return
yield self.ensure(_error_callback, _consume)
def cancel_consumer_thread(self):

View File

@ -440,7 +440,7 @@ class Connection(object):
for iteration in itertools.count(0):
if limit and iteration >= limit:
raise StopIteration
return
yield self.ensure(_error_callback, _consume)
def cancel_consumer_thread(self):

View File

@ -294,7 +294,7 @@ class ResponseBodyIterator(object):
if chunk:
return chunk
else:
raise StopIteration()
return
# In Python 3, __next__() has replaced next().
__next__ = next