Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last Update BUG #255

Open
preussal opened this issue Dec 4, 2020 · 2 comments
Open

Last Update BUG #255

preussal opened this issue Dec 4, 2020 · 2 comments

Comments

@preussal
Copy link
Contributor

preussal commented Dec 4, 2020

After the update "Merge branch 'master' into master" there is an error
9bc7333

[ERROR   ] Rendering exception occurred
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 498, in render_jinja_tmpl
    output = template.render(**decoded_context)
  File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render
    return original_render(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "<template>", line 23, in top-level template code
jinja2.exceptions.UndefinedError: 'dict object' has no attribute 'startswith'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 260, in render_tmpl
    output = render_str(tmplstr, context, tmplpath)
  File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 505, in render_jinja_tmpl
    raise SaltRenderError("Jinja variable {}{}".format(exc, out), buf=tmplstr)
salt.exceptions.SaltRenderError: Jinja variable 'dict object' has no attribute 'startswith'
[CRITICAL] Rendering SLS 'base:mysql.server' failed: Jinja variable 'dict object' has no attribute 'startswith'

Change in mysql/server.sls the line From
elif mysql.server.startswith('percona-server-server') %}
to
elif mysql.server.startswith is defined and mysql.server.startswith('percona-server-server') %}

then it works

@noelmcloughlin
Copy link
Member

Can you raise PR please?

@myii
Copy link
Member

myii commented Dec 5, 2020

@noelmcloughlin This isn't a simple fix as mentioned above. This regression has been introduced by the merge of #185, which was actually based around mysql being the following (as opposed to the whole map):

{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:lookup')) %}

This version of the file is from around that time:

{%- set mysql = salt['grains.filter_by'](rawmap, grain='os', merge=salt['pillar.get']('mysql:lookup')) %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants