cfn-model 0.4.6 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 203d06651118db7866fd78a6ca8fab93040ce9944193a491a0495513d283e9a8
|
4
|
+
data.tar.gz: 89ece250c90b5cfaacba9bc3304eb89b76cb1bc0bd12b1d4e09ee777cb2f1a49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b573849cfa9518bd0e4d3e537312fc2b10dfbc867480b29dd4a75f421caedde8502e9a23493ddbc6580e90e20ae9457ab09fe24003f043df1394ca04996fe5e6
|
7
|
+
data.tar.gz: 6fa3f35aeeb5eb5ab7d4b1fa155769ea93a6295781a786286f3932c88b6f5e3aa3eb85df7d39d62e574726ada59c1f9f5316ff6c6cf32385e26c68d36cb2be96
|
@@ -12,7 +12,7 @@ class CloudFormationValidator
|
|
12
12
|
|
13
13
|
schema = SchemaGenerator.new.generate cloudformation_string
|
14
14
|
validator = Kwalify::Validator.new(schema)
|
15
|
-
validator.validate(YAML.
|
15
|
+
validator.validate(YAML.load(cloudformation_string))
|
16
16
|
end
|
17
17
|
|
18
18
|
private
|
@@ -5,7 +5,7 @@ require 'cfn-model/parser/parser_error'
|
|
5
5
|
class ResourceTypeValidator
|
6
6
|
|
7
7
|
def self.validate(cloudformation_yml)
|
8
|
-
hash = YAML.
|
8
|
+
hash = YAML.load cloudformation_yml
|
9
9
|
if hash == false || hash.nil?
|
10
10
|
raise ParserError.new 'yml empty'
|
11
11
|
end
|
@@ -19,7 +19,7 @@ class SchemaGenerator
|
|
19
19
|
parameters_schema = generate_schema_for_parameter_keys cloudformation_hash
|
20
20
|
resources_schema = generate_schema_for_resource_keys cloudformation_hash
|
21
21
|
|
22
|
-
main_schema = YAML.
|
22
|
+
main_schema = YAML.load IO.read(schema_file('schema.yml.erb'))
|
23
23
|
if parameters_schema.empty?
|
24
24
|
main_schema['mapping'].delete 'Parameters'
|
25
25
|
else
|
@@ -82,7 +82,7 @@ class SchemaGenerator
|
|
82
82
|
if !File.exist? schema_file_path
|
83
83
|
nil
|
84
84
|
else
|
85
|
-
YAML.
|
85
|
+
YAML.load IO.read(schema_file_path)
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|