You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The osmajorrelease grain has been changed from a string to an integer. State files, especially those using a templating language like Jinja, may need to be adjusted to account for this change.
I ran into this with errors from salt-formula/salt/map.jinja:
[ERROR ] Rendering exception occurred: Jinja error: coercing to Unicode: need string or buffer, int found
/var/cache/salt/minion/files/base/salt/map.jinja(12):
---
[...]
{##
Setup variable using grains['os_family'] based logic, only add key:values here
that differ from whats in defaults.yaml
##}
{% set osrelease = salt['grains.get']('osrelease') %}
{% set os_family_map = salt['grains.filter_by']({ <======================
'Debian': {
'pkgrepo': 'deb http://repo.saltstack.com/apt/' +
salt['grains.get']('os')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/amd64/latest ' + salt['grains.get']('oscodename') + ' main',
'key_url': 'https://repo.saltstack.com/apt/' + salt['grains.get']('os')|lower + '/' + salt['grains.get']('osmajorrelease', osrelease) + '/amd64/latest/SALTSTACK-GPG-KEY.pub',
'libgit2': 'libgit2-22',
[...]
---
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 410, in render_jinja_tmpl
output = template.render(**decoded_context)
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "<template>", line 1, in top-level template code
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 1073, in make_module
return TemplateModule(self, self.new_context(vars, shared, locals))
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 1152, in __init__
body_stream = list(template.root_render_func(context))
File "/var/cache/salt/minion/files/base/salt/map.jinja", line 12, in top-level template code
{% set os_family_map = salt['grains.filter_by']({
TypeError: coercing to Unicode: need string or buffer, int found
Changing references in salt-formula/salt/map.jinja from:
From the salt 2017.7.0 'nitrogen' release notes:
I ran into this with errors from
salt-formula/salt/map.jinja
:Changing references in
salt-formula/salt/map.jinja
from:to:
seemed to have it work.
The text was updated successfully, but these errors were encountered: