diff --git a/molecule/model/schema_v2.py b/molecule/model/schema_v2.py index b7c20eb31e..da7986c3d3 100644 --- a/molecule/model/schema_v2.py +++ b/molecule/model/schema_v2.py @@ -261,7 +261,30 @@ def pre_validate_base_schema(env, keep_string): }, } }, - 'platforms': {}, + 'platforms': { + 'type': 'list', + 'schema': { + 'type': 'dict', + 'schema': { + 'name': { + 'type': 'string', + 'required': True, + }, + 'groups': { + 'type': 'list', + 'schema': { + 'type': 'string', + } + }, + 'children': { + 'type': 'list', + 'schema': { + 'type': 'string', + } + }, + } + } + }, 'provisioner': { 'type': 'dict', 'schema': { @@ -511,33 +534,6 @@ def pre_validate_base_schema(env, keep_string): }, } -platforms_base_schema = { - 'platforms': { - 'type': 'list', - 'schema': { - 'type': 'dict', - 'schema': { - 'name': { - 'type': 'string', - 'required': True, - }, - 'groups': { - 'type': 'list', - 'schema': { - 'type': 'string', - } - }, - 'children': { - 'type': 'list', - 'schema': { - 'type': 'string', - } - }, - } - } - }, -} - platforms_vagrant_schema = { 'platforms': { 'type': 'list', @@ -975,7 +971,7 @@ def validate(c): util.merge_dicts(schema, dependency_command_nullable_schema) # Driver - util.merge_dicts(schema, platforms_base_schema) + util.merge_dicts(schema, base_schema) if c['driver']['name'] == 'docker': util.merge_dicts(schema, platforms_docker_schema) elif c['driver']['name'] == 'vagrant': @@ -986,7 +982,7 @@ def validate(c): elif c['driver']['name'] == 'linode': util.merge_dicts(schema, platforms_linode_schema) else: - util.merge_dicts(schema, platforms_base_schema) + util.merge_dicts(schema, base_schema) # Verifier if c['verifier']['name'] == 'goss':