saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.19k stars 5.48k forks source link

salt-ssh `salt.grains.get()` raises `TypeError: get() missing 1 required positional argument: 'default'` [BUG] #62364

Closed jbartak closed 1 year ago

jbartak commented 2 years ago

Description When I call:

  {% if 'opensips' in salt.grains.get('roles') %}
  foo: bar
  {% endif %}

This is raised:

TypeError: get() missing 1 required positional argument: 'default'
Click to expand! ``` $ sudo salt-ssh 1.dummy.global-devel state.apply bootstrap test=true [ERROR ] Rendering exception occurred Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/salt/utils/templates.py", line 500, in render_jinja_tmpl output = template.render(**decoded_context) File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 1090, in render self.environment.handle_exception() File "/usr/lib/python3.6/site-packages/jinja2/environment.py", line 832, in handle_exception reraise(*rewrite_traceback_stack(source=source)) File "/usr/lib/python3.6/site-packages/jinja2/_compat.py", line 28, in reraise raise value.with_traceback(tb) File "