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

Salt-SSH Jinja2 pillar/grains module property-like loading borks as it returns a function wrapper #39720

Closed
The-Loeki opened this issue Feb 28, 2017 · 4 comments
Labels
info-needed waiting for more info stale
Milestone

Comments

@The-Loeki
Copy link
Contributor

The-Loeki commented Feb 28, 2017

Salt-SSH does some magical override-fu on pillars & grains.
This is the most likely cause for the fact that both the pillar and grain module cannot be used in conjunction with Jinja2's property-like syntax.

Reproduce

thiswontwork:
  {{ salt.pillar.get('mypillar:data', False) }}
neitherwillthis:
  {{ salt.grains.get('init', False) }}
thiswill:
  {{ salt['pillar.get']('mypillar:data', False) }}
thistoo:
  {{ pillar.get('mypillar:data', False) }}
andthis:
  {{ salt.file.file_exists('/tmp', False) }}

Output roughly:

thiswontwork:
      <function caller at 0x7f4edb3a0848>
neitherwillthis:
      <function caller at 0x7f4edb3a0848>
thiswill:
      False
thistoo:
      False
andthis:
     True

Versions Report

Salt Version:
           Salt: 2016.11.0               # It actually came from the git branch
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 2.4.2
          gitdb: 0.6.4
      gitpython: 2.0.5
          ioflo: Not Installed
         Jinja2: 2.8
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.24.0
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.4.8
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.12+ (default, Sep 17 2016, 12:08:02)
   python-gnupg: Not Installed
         PyYAML: 3.11
          PyZMQ: 15.2.0
           RAET: Not Installed
          smmap: 0.9.0
        timelib: Not Installed
        Tornado: 4.4.2
            ZMQ: 4.2.0
 
System Versions:
           dist: Ubuntu 16.10 yakkety
        machine: x86_64
        release: 4.8.0-39-generic
         system: Linux
        version: Ubuntu 16.10 yakkety

The client is a Yakkety VM w/Py3 and Py2 installed.
Only pillar_roots is active & used, no ext_pillars.

@gtmanfred
Copy link
Contributor

What command are you running to get that output?

Thanks,
Daniel

@gtmanfred gtmanfred added the info-needed waiting for more info label Mar 1, 2017
@gtmanfred gtmanfred added this to the Blocked milestone Mar 1, 2017
@The-Loeki
Copy link
Contributor Author

@gtmanfred this is a 'regular' SLS file, so state.sls imateapot or something like that ;)

@The-Loeki The-Loeki changed the title Salt-SSH pillar.get func borks as it returns a function wrapper Salt-SSH Jinja2 pillar/grains module property-like loading borks as it returns a function wrapper Mar 8, 2017
@The-Loeki
Copy link
Contributor Author

Might be partially fixed by #40400

@stale
Copy link

stale bot commented Oct 3, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Oct 3, 2018
@stale stale bot closed this as completed Oct 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed waiting for more info stale
Projects
None yet
Development

No branches or pull requests

2 participants