make sure only a non-empty file is loaded

Signed-off-by: reyesj2 <94730068+reyesj2@users.noreply.github.com>
This commit is contained in:
reyesj2
2025-02-19 09:23:48 -06:00
parent a3dba9b566
commit 45c66b93d7

View File

@@ -16,10 +16,13 @@
{# start generation of integration default index_settings #} {# start generation of integration default index_settings #}
{% if salt['file.file_exists']('/opt/so/state/esfleet_package_components.json') %} {% if salt['file.file_exists']('/opt/so/state/esfleet_package_components.json') %}
{% set check_package_components = salt['file.stats']('/opt/so/state/esfleet_package_components.json') %}
{% if check_package_components.size > 1 %}
{% from 'elasticfleet/integration-defaults.map.jinja' import ADDON_INTEGRATION_DEFAULTS %} {% from 'elasticfleet/integration-defaults.map.jinja' import ADDON_INTEGRATION_DEFAULTS %}
{% for index, settings in ADDON_INTEGRATION_DEFAULTS.items() %} {% for index, settings in ADDON_INTEGRATION_DEFAULTS.items() %}
{% do ES_INDEX_SETTINGS_ORIG.update({index: settings}) %} {% do ES_INDEX_SETTINGS_ORIG.update({index: settings}) %}
{% endfor %} {% endfor %}
{% endif%}
{% endif %} {% endif %}
{# end generation of integration default index_settings #} {# end generation of integration default index_settings #}