From 9618e388c391802a4a8a277c4dd176c4a41b840a Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 10 Apr 2021 16:33:32 +0200 Subject: [PATCH] bundles/simple-icinga-dashboard: only resolve faults when rendering the template, not earlier --- bundles/simple-icinga-dashboard/files/config.toml | 4 ++++ bundles/simple-icinga-dashboard/items.py | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) create mode 100644 bundles/simple-icinga-dashboard/files/config.toml diff --git a/bundles/simple-icinga-dashboard/files/config.toml b/bundles/simple-icinga-dashboard/files/config.toml new file mode 100644 index 0000000..fa7a45f --- /dev/null +++ b/bundles/simple-icinga-dashboard/files/config.toml @@ -0,0 +1,4 @@ +<% + from tomlkit import dumps as toml_dumps + from bundlewrap.utils.text import toml_clean +%>${toml_clean(toml_dumps(repo.libs.toml.dict_to_toml(node.metadata['simple-icinga-dashboard'])))} diff --git a/bundles/simple-icinga-dashboard/items.py b/bundles/simple-icinga-dashboard/items.py index 9ee2ef1..b3dc949 100644 --- a/bundles/simple-icinga-dashboard/items.py +++ b/bundles/simple-icinga-dashboard/items.py @@ -1,6 +1,3 @@ -from tomlkit import dumps as toml_dumps - -from bundlewrap.utils.text import toml_clean users = { 'icinga_dashboard': { @@ -24,7 +21,7 @@ git_deploy = { files = { '/opt/simple-icinga-dashboard/src/config.toml': { - 'content': toml_clean(toml_dumps(repo.libs.toml.dict_to_toml(node.metadata['simple-icinga-dashboard']))), + 'content_type': 'mako', 'needs': { 'git_deploy:/opt/simple-icinga-dashboard/src', },