Fix stress runner not stopping on first fail
Use of for-loop as condition if to 'break' while-loop
caused that only the 'condition' itself was stopped
from iterating, not stopping the parent loop as desired.
Change-Id: Ic1d3e55b7f4aa14132ebff2d533b5a61a8bad5ae
diff --git a/tempest/stress/driver.py b/tempest/stress/driver.py
index e8ccc7c..517cfd5 100644
--- a/tempest/stress/driver.py
+++ b/tempest/stress/driver.py
@@ -198,9 +198,9 @@
time.sleep(min(remaining, log_check_interval))
if stop_on_error:
- for process in processes:
- if process['statistic']['fails'] > 0:
- break
+ if any([True for proc in processes
+ if proc['statistic']['fails'] > 0]):
+ break
if not logfiles:
continue