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 master mode's and salt-ssh mode's top.sls processing aren't the same #34345

Closed
edgan opened this issue Jun 28, 2016 · 1 comment
Closed
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt P4 Priority 4 Renderers Salt-SSH severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Milestone

Comments

@edgan
Copy link
Contributor

edgan commented Jun 28, 2016

I am trying to use the delimiter option of grains.get. It works in salt master mode, but fails in salt-ssh mode. The reason I need the delimiter option is part of the grain path is the mac address of the instance, and it contains colons.

top.sls:

{% if salt['grains.get']('ec2|network|interfaces|macs|' ~ salt['grains.get']('ec2|mac', delimiter='|') ~ '|vpc_id', delimiter='|') == 'vpc-a3fbca73' %}

Error:

[ERROR   ] Rendering exception occurred: Jinja error: get() got an unexpected keyword argument 'delimiter'
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/salt/utils/templates.py", line 366, in render_jinja_tmpl
    output = template.render(**decoded_context)
  File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "<template>", line 23, in top-level template code
TypeError: get() got an unexpected keyword argument 'delimiter'
@Ch3LL
Copy link
Contributor

Ch3LL commented Jun 29, 2016

@edgan i am able to replicate this behavior just using that same jinja logic in a state file as well so I don't think its related to just the top file.

Running state.sls works just fine via a normal master/minion setup. But whne using salt-ssh I get the same error:

---
ch3ll-test2:
    - Rendering SLS 'base:issues.34345' failed: Jinja error: get() got an unexpected keyword argument 'delimiter'
      Traceback (most recent call last):
        File "/home/ch3ll/git/salt/salt/utils/templates.py", line 366, in render_jinja_tmpl
          output = template.render(**decoded_context)
        File "/usr/lib64/python2.7/site-packages/jinja2/environment.py", line 989, in render
          return self.environment.handle_exception(exc_info, True)
        File "/usr/lib64/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
          reraise(exc_type, exc_value, tb)
        File "<template>", line 1, in top-level template code
      TypeError: get() got an unexpected keyword argument 'delimiter'

      ; line 1

      ---
      {% if salt['grains.get']('ec2|network|interfaces|macs|' ~ salt['grains.get']('ec2|mac', delimiter='|') ~ '|vpc_id', delimiter='|') == 'vpc-a3fbca73' %} {% endif %}    <======================

      Traceback (most recent call last):
        File "/home/ch3ll/git/salt/salt/utils/templates.py", line 366, in render_jinja_tmpl
          output = template.render(**decoded_context)
        File "/usr/lib64/python2.7/site-packages/jinja2/environment.py", line 989, in render
      [...]
      ---

Looks like we definitely need to get this fixed up.

@Ch3LL Ch3LL added Bug broken, incorrect, or confusing behavior P4 Priority 4 severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Core relates to code central or existential to Salt Renderers Salt-SSH labels Jun 29, 2016
@Ch3LL Ch3LL added this to the Approved milestone Jun 29, 2016
thatch45 added a commit to thatch45/salt that referenced this issue Jul 20, 2016
@thatch45 thatch45 mentioned this issue Jul 20, 2016
cachedout pushed a commit that referenced this issue Jul 21, 2016
gitebra pushed a commit to gitebra/salt that referenced this issue Jul 21, 2016
* upstream/develop: (32 commits)
  Update 2016.3.2 release notes (saltstack#34850)
  Skip GCE unit tests - causes test suite to hang
  Update release notes for 2016.3.2 (saltstack#34848)
  Fix comment in master config, prevents the service from starting
  Fix Salt failure after merge of saltstack#34683
  drop parsing of vdevs, error passthrough from zpool cli
  eliminate hardcoded vdev type from zpool state
  update the state wrapper to include show_low_sls
  salt.states.zpool - work with updates exec module
  salt.module.zpool - fix bug with properties on/off being parsed as true/false
  Check if a valid value is passed to unlyif/unless
  Fix saltstack#34345
  salt.modules.zpool - drop vdev types to make it more future proof, fallback to zpool cli error messages
  keep this beacon from stack tracing at the loader (saltstack#34825)
  Skip mysql state test if mysqladmin is not available
  Lintfix PEP8: E262
  salt/state.py: set `chunk['order'] = 0' with `order: first'; fixes saltstack#24744
  Lint
  Document master setting
  Set up dynamic config
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt P4 Priority 4 Renderers Salt-SSH severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around
Projects
None yet
Development

No branches or pull requests

3 participants