lib/aws/cfn/compiler/mixins/compile.rb in aws-cfn-compiler-0.9.20 vs lib/aws/cfn/compiler/mixins/compile.rb in aws-cfn-compiler-0.9.21
- old
+ new
@@ -264,24 +264,24 @@
hash.collect{|a|
find_maps(a,source)}.flatten.compact.uniq
end
end
- def find_conditions(hash)
+ def find_conditions(hash,level=0)
if hash.is_a? Hash
hash.keys.collect do |key|
- if 'Condition' == key
+ if 'Condition' == key and level <= 4
if hash[key].is_a?(Array)
hash[key].first
else
hash[key]
end
else
- find_conditions(hash[key])
+ find_conditions(hash[key],level+1)
end
end.flatten.compact.uniq
elsif hash.is_a? Array
- hash.collect{|a| find_conditions(a)}.flatten.compact.uniq
+ hash.collect{|a| find_conditions(a,level+1)}.flatten.compact.uniq
end
end
def map_resource_reference(rsrc)
path = nil