ben-grande / qusal

Salt Formulas for Qubes OS.
14 stars 6 forks source link

Other jinja parsing errors: dom0 recipe #36

Closed tlaurion closed 3 months ago

tlaurion commented 3 months ago

Commitment

I confirm that I have read the following resources:

Software version

4ac0ec9613ebc10b7e32ae4a6081b5ec45dd1bef

Brief summary

dom0 recipe fails to apply

Steps to reproduce

See below

Expected behavior

Works

Actual behavior

Doesn't work:

[user@dom0 ~/QubesIncoming/heads-tests-deb12-nix/qusal(main)]
(123)$ git rev-parse HEAD 
4ac0ec9613ebc10b7e32ae4a6081b5ec45dd1bef
[user@dom0 ~/QubesIncoming/heads-tests-deb12-nix/qusal(main)]
$ sudo qubesctl top.enable dom0
sudo qubesctl state.apply
sudo qubesctl top.disable dom0
local:
    ----------
    dom0.top:
        ----------
        status:
            enabled
[WARNING ] top_file_merging_strategy is set to 'merge' and multiple top files were found. Merging order is not deterministic, it may be desirable to either set top_file_merging_strategy to 'same' or use the 'env_order' configuration parameter to specify the merging order.
[ERROR   ] Rendering exception occurred
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/salt/utils/templates.py", line 476, in render_jinja_tmpl
    output = template.render(**decoded_context)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/jinja2/environment.py", line 1291, in render
    self.environment.handle_exception()
  File "/usr/lib/python3.11/site-packages/jinja2/environment.py", line 925, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 19, in top-level template code
  File "/usr/lib/python3.11/site-packages/jinja2/sandbox.py", line 391, in call
    if not __self.is_safe_callable(__obj):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/jinja2/sandbox.py", line 275, in is_safe_callable
    getattr(obj, "unsafe_callable", False) or getattr(obj, "alters_data", False)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
jinja2.exceptions.UndefinedError: 'load' is undefined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/salt/utils/templates.py", line 218, in render_tmpl
    output = render_str(tmplstr, context, tmplpath)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/salt/utils/templates.py", line 482, in render_jinja_tmpl
    raise SaltRenderError("Jinja variable {}{}".format(exc, out), line, tmplstr)
salt.exceptions.SaltRenderError: Jinja variable 'load' is undefined; line 19

---
[...]
  - qubes-vm-update-if-stale: 4
  - qubes-vm-update-max-concurrency: 4
  - qubes-vm-update-restart-system: 1
  - qubes-vm-update-restart-other: 0
{%- endload %}
{{ load(defaults) }}    <======================

{% endif -%}
---
[CRITICAL] Rendering SLS 'base:dom0.update-settings' failed: Jinja variable 'load' is undefined; line 19

---
[...]
  - qubes-vm-update-if-stale: 4
  - qubes-vm-update-max-concurrency: 4
  - qubes-vm-update-restart-system: 1
  - qubes-vm-update-restart-other: 0
{%- endload %}
{{ load(defaults) }}    <======================

{% endif -%}
---
local:
    Data failed to compile:
----------
    Rendering SLS 'base:dom0.update-settings' failed: Jinja variable 'load' is undefined; line 19

---
[...]
  - qubes-vm-update-if-stale: 4
  - qubes-vm-update-max-concurrency: 4
  - qubes-vm-update-restart-system: 1
  - qubes-vm-update-restart-other: 0
{%- endload %}
{{ load(defaults) }}    <======================

{% endif -%}
---
DOM0 configuration failed, not continuing
local:
    ----------
    disabled:
        - dom0.top
    unchanged:
        - dom0.top
[user@dom0 ~/QubesIncoming/heads-tests-deb12-nix/qusal(main)]