lib/aws/cfn/compiler/base.rb in aws-cfn-compiler-0.9.23 vs lib/aws/cfn/compiler/base.rb in aws-cfn-compiler-0.9.24
- old
+ new
@@ -69,14 +69,14 @@
end
if hash.has_key?('Default')
@logger.debug "#{name} is a #{hash['Type']} and 'Default' is #{hash['Default']}"
case hash['Type']
when /String/
- abort! "Parameter #{name} has an invalid Default: #{hash['Default']}" unless hash['Default'].is_a?(String)
+ abort! "Parameter #{name} has an invalid Default: #{hash['Default']}(#{hash['Default'].class})" unless hash['Default'].is_a?(String)
when /Number/
- abort! "Parameter #{name} has an invalid Default: #{hash['Default']}" unless (hash['Default'].is_a?(Numeric))
- when /CommaDelimetedList/
- abort! "Parameter #{name} has an invalid Default: #{hash['Default']}" unless (hash['Default'].is_a?(Array))
+ abort! "Parameter #{name} has an invalid Default: #{hash['Default']}(#{hash['Default'].class})" unless (hash['Default'].is_a?(Numeric) or hash['Default'].is_a?(String))
+ when /CommaDelimitedList/
+ abort! "Parameter #{name} has an invalid Default: #{hash['Default']}(#{hash['Default'].class})" unless (hash['Default'].is_a?(Array) or (hash['Default'].is_a?(String) and hash['Default'].split(%r'\s*,\s*').size > 0))
else
abort! "Parameter #{name} has an invalid type: #{hash['Type']}"
end
end
end