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

SLS Rendering Error - 2017.7.0 #329

Closed
ghovat opened this issue Aug 9, 2017 · 4 comments
Closed

SLS Rendering Error - 2017.7.0 #329

ghovat opened this issue Aug 9, 2017 · 4 comments

Comments

@ghovat
Copy link

ghovat commented Aug 9, 2017

Hi,
I have a bug with a salt minion version 2017.7.0 (master has the same version [ there are no problems])
During a state.apply I get from salt-formula a Rendering error:

local:
    Data failed to compile:
----------
    Rendering SLS 'base:salt.minion' failed: Jinja variable 'dict object' has no attribute 'iteritems'
/var/cache/salt/minion/files/base/salt/map.jinja(8):
---
[...]

{%- macro deep_merge(a, b) %}
{#-     This whole `'dict' in x.__class__.__name__` mess is a 
        workaround for the missing mapping test in CentOS 6's 
        ancient Jinja2, see #193  #}
{%-     for k,v in b.iteritems() %}    <======================
{%-         if v is string or v is number %}
{%-             do a.update({ k: v }) %}
{%-         elif 'dict' not in v.__class__.__name__ %}
{%-             if a[k] is not defined %}
{%-                 do a.update({ k: v }) %}
[...]
---

Salt is on the newest version and also salt-formula is on the latest state.
Do you have a fix for this issue?
Thanks
best
G

@mechleg
Copy link
Contributor

mechleg commented Aug 9, 2017

Without knowing the versions of OS and other software you are running, I am guessing you are seeing the issue where Python 3.x has removed the dict.iteritems() function.

IIRC, you can just replace iteritems() with items() and it should work the same. I believe this is related to #296

@0xf10e
Copy link
Contributor

0xf10e commented Aug 10, 2017

Yeah, that's #296. I'm surprised an instance of iteritems() survived for so long as the preparation for python 3 compatibility is going on for at least two years.

@ghovat
Copy link
Author

ghovat commented Aug 10, 2017

@mechleg @0xf10e Yes that was the problem.
Is there a official fix planned?

@ghovat ghovat closed this as completed Aug 10, 2017
@aboe76
Copy link
Member

aboe76 commented Aug 14, 2017

@ghovat see pr #330

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

4 participants