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

REGRESSION: pillar.get of integer fails to render in sls #25041

Closed
wt opened this issue Jun 29, 2015 · 6 comments
Closed

REGRESSION: pillar.get of integer fails to render in sls #25041

wt opened this issue Jun 29, 2015 · 6 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior fixed-pls-verify fix is linked, bug author to confirm fix P1 Priority 1 Regression The issue is a bug that breaks functionality known to work in previous releases. severity-critical top severity, seen by most users, serious issues severity-high 2nd top severity, seen by most users, causes major problems
Milestone

Comments

@wt
Copy link
Contributor

wt commented Jun 29, 2015

I believe that I am suffering from a regression in 2015.5.2 vs 2015.5.0 on Amazon Linux using the EPEL6 packages.

I have a pillar that contains an integer value. Let's just use the following pillar for an example:

service_id: 3

I also have a state file that has something like the following state in it:

/tmp/aaaa:
  file.managed:
    - contents: {{ salt['pillar.get']('service_id') }}
    - user: root
    - group: root
    - mode: 0755

With 2015.5.0, I get the following:

# salt-call state.template blah.sls 
[INFO    ] Loading fresh modules for state activity
...
[INFO    ] Running state [/tmp/aaaa] at time 18:16:33.488476
[INFO    ] Executing state file.managed for /tmp/aaaa
[INFO    ] File changed:
New file
[INFO    ] Completed state [/tmp/aaaa] at time 18:16:33.491319
local:
----------
          ID: /tmp/aaaa
    Function: file.managed
      Result: True
     Comment: File /tmp/aaaa updated
     Started: 18:16:33.488476
    Duration: 2.843 ms
     Changes:   
              ----------
              diff:
                  New file
              mode:
                  0755

Summary
------------
Succeeded: 1 (changed=1)
Failed:    0
------------
Total states run:     1

With 2015.5.2:

[INFO    ] Loading fresh modules for state activity
...
[INFO    ] Running state [/tmp/aaaa] at time 18:13:43.370206
[INFO    ] Executing state file.managed for /tmp/aaaa
[ERROR   ] "contents" is not a string or list of strings
[INFO    ] Completed state [/tmp/aaaa] at time 18:13:43.371312
local:
----------
          ID: /tmp/aaaa
    Function: file.managed
      Result: False
     Comment: "contents" is not a string or list of strings
     Started: 18:13:43.370206
    Duration: 1.106 ms
     Changes:   

Summary
------------
Succeeded: 0
Failed:    1
------------
Total states run:     1
@wt
Copy link
Contributor Author

wt commented Jun 29, 2015

Here's the version of my epel packages for comparison: 2015.5.0-1.el6 and 2015.5.2-3.el6.

@thatch45 thatch45 added Bug broken, incorrect, or confusing behavior Regression The issue is a bug that breaks functionality known to work in previous releases. severity-high 2nd top severity, seen by most users, causes major problems severity-critical top severity, seen by most users, serious issues P1 Priority 1 labels Jun 29, 2015
@thatch45
Copy link
Contributor

Thanks @wt this is a serious regression and we will make sure to add tests for this case as well

@wt
Copy link
Contributor Author

wt commented Jun 29, 2015

As a workaround, I surrounded the template expansion in the contents field with double quotes. I just want to document this workaround for anyone else suffering from this regression.

@thatch45
Copy link
Contributor

Thanks for that @wt ! Hopefully we can have a fix in soon

@justinta justinta added this to the Approved milestone Jun 29, 2015
@jfindlay jfindlay added the Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases label Jun 29, 2015
@jfindlay jfindlay self-assigned this Jun 30, 2015
@jfindlay jfindlay modified the milestones: Be 3, Approved Jun 30, 2015
@SaltDBray SaltDBray assigned cachedout and unassigned jfindlay Jun 30, 2015
@SaltDBray
Copy link

Mike, can you look at this?

@jfindlay
Copy link
Contributor

I am very close to a fix (and some tests) for this.

@jfindlay jfindlay added fixed-pls-verify fix is linked, bug author to confirm fix and removed Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases labels Jun 30, 2015
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 P1 Priority 1 Regression The issue is a bug that breaks functionality known to work in previous releases. severity-critical top severity, seen by most users, serious issues severity-high 2nd top severity, seen by most users, causes major problems
Projects
None yet
Development

No branches or pull requests

6 participants