Skip to content

Commit 592a28f

Browse files
authored
Switch max condition logic to attemptes over returned (#3359)
1 parent 0a218f3 commit 592a28f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cfnlint/conditions/conditions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def build_scenarios(
200200
try:
201201
# build a large matric of True/False options
202202
# based on the provided conditions
203-
scenarios_returned = 0
203+
scenarios_attempted = 0
204204
if region:
205205
products = itertools.starmap(
206206
self.build_scenerios_on_region,
@@ -229,11 +229,11 @@ def build_scenarios(
229229
# if the scenario can be satisfied then return it
230230
if satisfiable(cnf):
231231
yield {**params, **conditions_set}
232-
scenarios_returned += 1
233232

233+
scenarios_attempted += 1
234234
# On occassions people will use a lot of non-related conditions
235235
# this is fail safe to limit the maximum number of responses
236-
if scenarios_returned >= self._max_scenarios:
236+
if scenarios_attempted >= self._max_scenarios:
237237
return
238238
except KeyError:
239239
# KeyError is because the listed condition doesn't exist because of bad

0 commit comments

Comments
 (0)