You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pillar.get in jinja template behavior looks improper. When directly calling get substructure - it's returns it right way, when calling in jinja template - returns literally None
Setup
[ ESXi] VM (Virtualbox, KVM, etc. please specify)
Simple VM's for minions and server , runs same on any machine
template part - not works as expected, returns None and sure no .items etc methods/substructures
#
{% for x,y in pillar.get('ntp:servers').items() %}
server {{ x }} iburst
{% endfor %}
#
But it's works if called with root element and driven to substructures in code. Therefore it's not definitely intended behavior cause other substructures can contain a LOT of data and even auto refresh of pillar data is disabled in saltstack due to this.
#
{% for x,y in pillar.get('ntp').servers.items() %}
server {{ x }} iburst
{% endfor %}
#
Expected behavior
Expected to get data substructures from yaml as described in pillar.get usage manual with : delimiter
#
{% for x,y in pillar.get('ntp:servers').items() %}
server {{ x }} iburst
{% endfor %}
#
iterated over .ntp.servers yaml path items, but it's returns None while directly calling salt 'host' pillar.get ntp:servers returns correct data
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at [email protected]. We’re glad you’ve joined our community and look forward to doing awesome things with you!
freemjohn
changed the title
[BUG] pillar.get on substructure is broken or i'm donig something wrong?
[BUG] pillar.get on substructure is broken or i'm doing it wrong?
Jan 14, 2025
You want salt.pillar.get('ntp:servers') as that calls the execution module function pillar.get.
Calling pillar.get(..) is actually acting on the dict named pillar and is the standard python .get() function
You want salt.pillar.get('ntp:servers') as that calls the execution module function pillar.get. Calling pillar.get(..) is actually acting on the dict named pillar and is the standard python .get() function
Description
pillar.get in jinja template behavior looks improper. When directly calling get substructure - it's returns it right way, when calling in jinja template - returns literally None
Setup
Simple VM's for minions and server , runs same on any machine
Steps to Reproduce the behavior
pillar sls
state sls for templating definition
Tests with manual checking pillar.get
template part - not works as expected, returns None and sure no .items etc methods/substructures
But it's works if called with root element and driven to substructures in code. Therefore it's not definitely intended behavior cause other substructures can contain a LOT of data and even auto refresh of pillar data is disabled in saltstack due to this.
Expected behavior
Expected to get data substructures from yaml as described in pillar.get usage manual with : delimiter
iterated over .ntp.servers yaml path items, but it's returns None while directly calling salt 'host' pillar.get ntp:servers returns correct data
Versions Report
Salt Version:
Salt: 3007.0
Python Version:
Python: 3.11.10 (main, Sep 9 2024, 00:00:00) [GCC 12.4.1 20240730 (RED SOFT 12.4.0-1)]
Dependency Versions:
cffi: 1.15.1
cherrypy: unknown
dateutil: 2.8.2
docker-py: 5.0.3
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 3.1.3
libgit2: Not Installed
looseversion: 1.3.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.4
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 24.1
pycparser: 2.20
pycrypto: Not Installed
pycryptodome: 3.15.0
pygit2: Not Installed
python-gnupg: 0.5.0
PyYAML: 6.0.1
PyZMQ: 23.2.0
relenv: Not Installed
smmap: Not Installed
timelib: 0.3.0
Tornado: 6.3.3
ZMQ: 4.3.4
Salt Package Information:
Package Type: Not Installed
System Versions:
dist: redos 8.0 n/a
locale: utf-8
machine: x86_64
release: 6.6.51-1.red80.x86_64
system: Linux
version: RED OS 8.0 n/a
But OS does not matters, reproducable on any host with same version, e.g. Ubuntu22, OEL8...
The text was updated successfully, but these errors were encountered: