File tree 2 files changed +6
-2
lines changed
src/cfnlint/context/conditions 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,9 @@ def create_from_instance(
66
66
raise ValueError (f"Condition value { fn_v !r} must be a string" )
67
67
sub_condition = all_conditions .get (fn_v )
68
68
try :
69
- c = Condition .create_from_instance (sub_condition , all_conditions )
69
+ sub_all_conditions = all_conditions .copy ()
70
+ del sub_all_conditions [fn_v ]
71
+ c = Condition .create_from_instance (sub_condition , sub_all_conditions )
70
72
except Exception :
71
73
c = Condition .create_from_instance (
72
74
{"Fn::Equals" : [None , None ]}, all_conditions
Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ def create_from_instance(
41
41
raise ValueError ("Conditions must be a object" )
42
42
for k , v in conditions .items ():
43
43
try :
44
- obj [k ] = Condition .create_from_instance (v , conditions )
44
+ other_conditions = conditions .copy ()
45
+ del other_conditions [k ]
46
+ obj [k ] = Condition .create_from_instance (v , other_conditions )
45
47
except ValueError :
46
48
# this is a default condition so we can keep the name but it will
47
49
# not associate with another condition and will always be true/false
You can’t perform that action at this time.
0 commit comments