summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Smith <dansmith@redhat.com>2021-03-08 13:28:58 -0800
committerDan Smith <dansmith@redhat.com>2021-03-08 13:30:34 -0800
commit80b84d4e970704bda6cb17ec74925c94637531d7 (patch)
treefda8d9fcfe96ca25a549ee10a3a0b33639daf7a1
parent23ed884c4bf8aaa9076c76f4aeeae8cfba7984d3 (diff)
downloadglance-80b84d4e970704bda6cb17ec74925c94637531d7.tar.gz
Fix erroneous exit from copy wait loop
The wait_for_copying() helper will exit the loop if the *last* store is found in the list, instead of *all* of them. This technically works if the stores are processed in the same order we are checking, but it's fragile and likely to fail in confusing ways. This makes us only exit if all of them are present. Change-Id: I8d9ba50f46e22b6740fdbdec6f8ef7c61dddbcf1
-rw-r--r--glance/tests/functional/ft_utils.py8
1 files changed, 1 insertions, 7 deletions
diff --git a/glance/tests/functional/ft_utils.py b/glance/tests/functional/ft_utils.py
index cbb075976..68d590bb9 100644
--- a/glance/tests/functional/ft_utils.py
+++ b/glance/tests/functional/ft_utils.py
@@ -114,13 +114,7 @@ def wait_for_copying(request_path, request_headers, stores=[],
raise Exception("Received {} response from server".format(
resp.status_code))
entity = jsonutils.loads(resp.text)
- all_copied = False
- for store in stores:
- if store in entity['stores']:
- all_copied = True
- else:
- all_copied = False
-
+ all_copied = all([store in entity['stores'] for store in stores])
if all_copied:
return