Merge "Fix to DeploymentData generation"

This commit is contained in:
Zuul 2019-05-26 17:01:37 +00:00 committed by Gerrit Code Review
commit 5b8bfd9211
2 changed files with 13 additions and 10 deletions

View File

@ -164,12 +164,12 @@ def _get_deployment_data_doc():
"metadata": { "metadata": {
"schema": "metadata/Document/v1", "schema": "metadata/Document/v1",
"name": "deployment-version", "name": "deployment-version",
"layeringDefinition": {
"abstract": False,
"layer": "global"
},
"storagePolicy": "cleartext",
}, },
"layeringDefinition": {
"abstract": "false",
"layer": "global"
},
"storagePolicy": "cleartext",
"data": { "data": {
"documents": stanzas "documents": stanzas
} }

View File

@ -19,13 +19,8 @@ import yaml
import click import click
from pegleg import cli
from pegleg import config
from pegleg.engine import errorcodes
from pegleg.engine import lint
from pegleg.engine import site from pegleg.engine import site
from pegleg.engine.util import deckhand from pegleg.engine.util import deckhand
from pegleg.engine.util import files
from tests.unit.fixtures import create_tmp_deployment_files from tests.unit.fixtures import create_tmp_deployment_files
@ -79,6 +74,14 @@ def _test_site_collect_to_file(tmpdir, site_name, collection_path):
assert sorted(_expected_document_names(site_name)) == sorted( assert sorted(_expected_document_names(site_name)) == sorted(
[x['metadata']['name'] for x in deployment_documents]) [x['metadata']['name'] for x in deployment_documents])
assert "pegleg/DeploymentData/v1" in lines assert "pegleg/DeploymentData/v1" in lines
# Make sure our generated YAMLs are valid
deckhand.deckhand_render(
documents=deployment_documents,
fail_on_missing_sub_src=False,
validate=True,
)
finally: finally:
if os.path.exists(collection_str_path): if os.path.exists(collection_str_path):
shutil.rmtree(collection_str_path, ignore_errors=True) shutil.rmtree(collection_str_path, ignore_errors=True)