[BUG] salt-call
grains module doesn't have access to pillar
#66486
Labels
salt-call
grains module doesn't have access to pillar
#66486
Description
What's particularly weird about this issue is that
salt-call
does have access to pillar when runningsalt-call saltutil.sync_grains
and/orsaltutil.refresh_grains
but doesn't when retrieiving the grain, e.g.salt-call grains.item
orsalt-call grains.get
. Using pillar in the__virtual__
function as shown below, this results in not being able to retrieve the custom grain withsalt-call
.Setup
Install salt-master and salt-minion on a VM. Configure with the following files.
Restart the minion and master, as necessary, and accept the minion key. Refresh pillar and sync_grains, as necessary.
Steps to Reproduce the behavior
After syncing grains via
saltutil.sync_grains
observe that you are able to retrieve the grain withbut not with
From the log statements included in the module, we can see in the logs that the pillar is not available when using
salt-call grains.item
, but is when callingsalt-call saltutil.sync_grains
(but looks like it's evaluated twice in the latter case and maybe why??)Expected behavior
salt-call
should behave the same as with thesalt
command in its ability to retrieve custom grains even when pillar is used in__virtual__
Versions Report
The text was updated successfully, but these errors were encountered: