-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
State.highstate uses stale grain data. #24073
Comments
@primechuck I tried to reproduce the issue in the following way: # top.sls
base:
'node_type:test':
- match: grain
- test
'node_type:foobar':
- match: grain
- foobar # foobar.sls
/tmp/GRAINS-{{ grains.get('node_type', '') }}:
file.managed:
- source: salt://foobar.sls
- require:
- file: /tmp/testfile4 On minion side I used a simple script to test the issue: saltCaller = Caller()
res = saltCaller.function('grains.append', 'node_type', 'foobar')
print("===== grains.append ret:\n{0}".format(res))
res = saltCaller.function('state.highstate')
print("===== grains.get ret:\n{0}".format(res)) I used v2015.5.0 tag. My versions report:
To let me continue investigation, could you please provide more details? |
There is a lot of missing logic, but the salt salls in the python look like this.
There is missing logic because the script is large, but those are all the salt calls in order. The highstate doesn't include the mysql.server role when it is run within the script, however, the grain exists in the minions grain file and if you call highstate again after the script is run, the mysql.server grain is read and the states completes with the grain data. When it did the highstate within python, the highstate doesn't include the appended data. top.sls sample
|
@primechuck thank you for details. I'll look at this. |
Exactly the same steps gave me the described results. Moreover I got the only 'roles:master' state in highstate. |
Glad I'm not the only one. We were testing migrating to 2015.5.0 from a 2014 and couldn't believe this was this issue :) If you need anything more let me know, I've tried to diagnose it to the best of my ability. |
The code sample I placed above is still failing for me with the same issue. High state isn't being passed the appended grains in the same script. |
@primechuck there is no the fix in Lithium release
|
Ah, saw the issue listed in the release notes without reading the fine print. Not used to github reports. |
@primechuck Did you get a chance to verify this fix prior to the release? We would like to close this issue if it's fixed and do any remaining work for the release if it isn't. Thanks! |
Using the python API
Using the python api running.
then immediately
Highstate doesn't see the newly appended grain. If highstate is run again after a few seconds or after a sync it sees the grain. The previous behavior in 2014 always grabbed grains when running highstate.
The text was updated successfully, but these errors were encountered: