saltstack / saltstack/salt

salt.renderers.jinja with (false) option only renders 1 level correctly

Open
#38,862 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Confirmed Core Renderers severity-medium
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description of Issue/Question

without (false) option

gitfs_saltenv:
                   [{sdev: [{ref: master}]}]

with (false) option

gitfs_saltenv:
    - sdev:
    - ref: master

Expected

 gitfs_saltenv:
    - sdev:
      - ref: master
Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

pillar.sls
      gitfs_saltenv:
        - sdev:
           - ref: master
state.sls
gitfs_saltenv:
  {{ remote.gitfs_saltenv|yaml(false) }}
Steps to Reproduce Issue

(Include debug logs if possible and relevant.)

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

root@salt-master-dev:/home/ubuntu# salt --versions-report
Salt Version:
           Salt: 2016.11.0

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 1.5
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 0.9.1
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
   python-gnupg: Not Installed
         PyYAML: 3.10
          PyZMQ: 14.0.1
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 4.4.0-34-generic
         system: Linux
        version: Ubuntu 14.04 trusty

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the nested-data case from pillar.sls through the salt.renderers.jinja entry point in state.sls, comparing yaml(false) with the default rendering. Trace how the renderer handles nested lists and verify that the output preserves the expected sdev/ref hierarchy.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.