Skip to content

Commit

Permalink
Changes to fix merging in main
Browse files Browse the repository at this point in the history
  • Loading branch information
kddejong committed Dec 15, 2023
1 parent 2d7f19d commit e0883af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/cfnlint/conditions/conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,9 @@ def build_scenarios(
)
else:
products = itertools.product([True, False], repeat=len(condition_names))

for p in products:
cnf = self._cnf.copy()
cnf = c_cnf.copy()
params = dict(zip(condition_names, p))
for condition_name, opt in params.items():
if opt:
Expand Down
6 changes: 3 additions & 3 deletions src/cfnlint/template/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ def is_resource_available(self, path, resource):

# if resource condition isn't available then the resource is available
return results

def get_object_without_nested_conditions(self, obj, path, region=None):
"""
Get a list of object values without conditions included.
Expand Down Expand Up @@ -991,7 +991,8 @@ def get_object_without_conditions(self, obj, property_names=None, region=None):
o = deepcopy(obj)
results = []

scenarios = self.get_conditions_scenarios_from_object([o], region)
scenarios = self.get_conditions_scenarios_from_object(o, region)

if isinstance(obj, list):
if not scenarios:
return [{"Scenario": None, "Object": o}]
Expand Down Expand Up @@ -1089,7 +1090,6 @@ def get_conditions_from_property(value):

return list(self.conditions.build_scenarios(dict.fromkeys(list(con)), region))


def get_conditions_from_path(
self,
text,
Expand Down
5 changes: 4 additions & 1 deletion test/unit/rules/resources/lmbd/test_snapstart_supported.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""
from test.unit.rules import BaseRuleTestCase

from cfnlint.config import ConfigMixIn
from cfnlint.rules.resources.lmbd.SnapStartEnabled import SnapStartEnabled
from cfnlint.rules.resources.lmbd.SnapStartSupported import SnapStartSupported

Expand All @@ -29,5 +30,7 @@ def test_file_negative(self):
self.helper_file_negative(
"test/fixtures/templates/bad/resources/lambda/snapstart-supported.yaml",
2,
regions=["us-east-1", "me-central-1"],
config=ConfigMixIn(
regions=["us-east-1", "me-central-1"],
),
)

0 comments on commit e0883af

Please sign in to comment.