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

Jinja2 mapping test failure on RHEL 6 #167

Closed
oznah opened this issue Aug 4, 2015 · 7 comments
Closed

Jinja2 mapping test failure on RHEL 6 #167

oznah opened this issue Aug 4, 2015 · 7 comments

Comments

@oznah
Copy link

oznah commented Aug 4, 2015

Salting minion fails on all RHEL 6 boxes with python-jinja2-2.2.1-2.el6_5.x86_64. Same run succeeds on RHEL 7 boxes with python-jinja2-2.7.2-2.el7.noarch.

----------
          ID: salt-minion
    Function: file.recurse
        Name: /etc/salt/minion.d
      Result: False
     Comment: #### /etc/salt/minion.d/f_defaults.conf ####
              Unable to manage file: Jinja syntax error: no test named 'mapping'
              /var/cache/salt/minion/files/prod/salt/formulas.jinja(14):
              ---
              [...]

              {%- macro formulas_git_opt(env, opt) -%}
              {%- set value = salt['pillar.get']('salt_formulas:git_opts:{0}:{1}'.format(env, opt),
                   salt['pillar.get']('salt_formulas:git_opts:default:{0}'.format(opt),
                     defaults[opt])) -%}
              {%- if value is mapping -%}    <======================
              {{ value|yaml }}
              {%- else -%}
              {{ value }}
              {%- endif -%}
              {%- endmacro -%}
              [...]
              ---
     Started: 22:55:39.879651
    Duration: 133.819 ms
     Changes:
@gravyboat
Copy link
Contributor

@oznah This is a duplicate of #93. Mappings don't exist in Jinja versions below 2.6.

@oznah
Copy link
Author

oznah commented Aug 4, 2015

@gravyboat My apologies. I looked for open issues, but didn't check the close. Is there a significant downside to commenting out the "if value" ? I'm trying to avoid pip install (ie. outside of package manager)

@gravyboat
Copy link
Contributor

@oznah No worries, I didn't mean to sound rude if it was taken that way. You'd probably be okay. I'd say just fork it and remove that chunk. Might take a bit of a workaround, but not a huge deal.

@oznah
Copy link
Author

oznah commented Aug 4, 2015

@gravyboat no I didn't think you were being rude. I just wanted to make sure I searched well before I opened something up. I commented out everything in that if statement except for {{ value|yaml }}. It seems to work, but I am not 100% clear what that if statement is checking for, so I wanted to make sure I wasn't hampering some major functionality by removing said lines.

@gravyboat
Copy link
Contributor

@oznah To be totally honest with you I haven't looked at this formula in a while so I'm not sure what functionality is lost if you drop that section.

@oznah
Copy link
Author

oznah commented Aug 4, 2015

fair enough. you can close the issue if you like.

@gravyboat
Copy link
Contributor

@oznah Will do, thanks!

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

2 participants