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

failed: Jinja variable 'dict object' has no attribute #16656

Closed
pedro-teixeira opened this issue Oct 15, 2014 · 16 comments
Closed

failed: Jinja variable 'dict object' has no attribute #16656

pedro-teixeira opened this issue Oct 15, 2014 · 16 comments
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix Regression The issue is a bug that breaks functionality known to work in previous releases. severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@pedro-teixeira
Copy link

After a apt-get upgrade I'm having problems with pillar variables and I can't see any error on my side.

Pillar

postfix:
  relay:
    host: "[smtp.example.org]:587"
    user: postmaster@example.org
    api_key: example

Salt

/etc/postfix/main.cf:
  file.managed:
    - source: salt://postfix/files/main.cf
    - template: jinja
    - user: root
    - group: root
    - mode: 644
    - makedirs: true
    - defaults:
        postfix: {{ pillar.postfix }}

/etc/postfix/sasl_passwd:
  file.managed:
    - source: salt://postfix/files/sasl_passwd
    - template: jinja
    - user: root
    - group: root
    - mode: 644
    - makedirs: true
    - defaults:
        postfix: {{ pillar.postfix }}

Result

----------
    Rendering SLS "dev:postfix.config" failed: Jinja variable 'dict object' has no attribute 'postfix'; line 34

---
[...]
   - user: root
   - group: root
   - mode: 644
   - makedirs: true
   - defaults:
       postfix: {{ pillar.postfix }}    <======================

---

Versions

salt-call 2014.1.11 (Hydrogen)
Ubuntu 14.04.1 LTS

@zheli
Copy link

zheli commented Oct 15, 2014

+1

@cachedout cachedout added Bug broken, incorrect, or confusing behavior severity-low 4th level, cosemtic problems, work around exists Regression The issue is a bug that breaks functionality known to work in previous releases. labels Oct 15, 2014
@cachedout cachedout added this to the Approved milestone Oct 15, 2014
@cachedout
Copy link
Contributor

Thanks for the report. We'll take a look.

@neilferreira
Copy link

+1

@shaunorman
Copy link

+ONE

@sevenseacat
Copy link

+1

1 similar comment
@shadowmint
Copy link

+1

@joelwhitehouse
Copy link

This issue is also affecting Ubuntu 12.04 LTS with salt-call 2014.1.11 (Hydrogen) running in masterless mode.

@pedro-teixeira
Copy link
Author

That's exactly my case. Do you know what version caused this problem so maybe we can rollback until the problem is not fixed?

@zheli
Copy link

zheli commented Oct 16, 2014

I went for git version v2014.1.5 and it works fine.

@cachedout cachedout added severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around and removed severity-low 4th level, cosemtic problems, work around exists labels Oct 16, 2014
@cachedout
Copy link
Contributor

This appears fixed in 2014.1.12 in my testing. Could somebody please confirm? Thanks!

@cachedout cachedout added the fixed-pls-verify fix is linked, bug author to confirm fix label Oct 16, 2014
@thatch45
Copy link
Contributor

@whiteinge you may know something we don't, I did not realize we had attribute lookups on the pillar dict in 2014.1. I will dive in.

@whiteinge
Copy link
Contributor

I haven't caught up on this issue yet but Jinja default behavior will do
dictionary lookups using dot-notation. That doesn't work with the Salt dict
because the keys have dots in the name. Thus my addition to the Jinja
renderer -- which should also affect Pillar. I don't know if that is
related to this or not.

@rallytime
Copy link
Contributor

I know we had a regression with 2014.1.11, but I believe this issue has been fixed with both 2014.1.13 and 2014.7.0. Is anyone still seeing this problem on either of those releases?

@dlax
Copy link
Contributor

dlax commented Nov 19, 2014

@rallytime I also had the problem with 2014.1.11 and went back to .7 in the meantime. I just tried with .13, and the issue does seem to be fixed.

@pedro-teixeira
Copy link
Author

Version 2014.1.13 is working fine for me with masterless on Ubuntu.

@rallytime
Copy link
Contributor

Excellent! I'm going to go ahead a close this issue then. If anyone is still seeing problems here, leave a comment and we'll happily re-open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix Regression The issue is a bug that breaks functionality known to work in previous releases. severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests