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

Heka support, TemplateRuntimeError: no test named 'equalto' #7

Open
epcim opened this issue Apr 10, 2017 · 0 comments
Open

Heka support, TemplateRuntimeError: no test named 'equalto' #7

epcim opened this issue Apr 10, 2017 · 0 comments

Comments

@epcim
Copy link
Member

epcim commented Apr 10, 2017

Related to recent merge of

{%- if server.get('enabled', False) and server.get('site', {}).values()|selectattr("type", "equalto", "keystone")|list|length > 0 %}

    Rendering SLS 'base:heka.metric_collector' failed: Jinja error: no test named 'equalto'
/var/cache/salt/minion/files/base/apache/meta/heka.yml(2):
---
{%- from "apache/map.jinja" import server with context %}
{%- if server.get('enabled', False) and server.get('site', {}).values()|selectattr("type", "equalto", "keystone")|list|length > 0 %}    <======================

log_collector:
  decoder:
{%- for site_name, site in server.site.iteritems() %}
{%- if site.type == 'keystone' %}
[...]
---
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 368, in render_jinja_tmpl
    output = template.render(**decoded_context)
  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 969, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 742, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "<template>", line 10, in top-level template code
  File "/var/cache/salt/minion/files/base/heka/_service.sls", line 151, in top-level template code
    {%- set grains_yaml = load_grains_file(grains_fragment_file)|load_yaml %}
  File "/var/cache/salt/minion/files/base/heka/_service.sls", line 1, in template
    {%- macro load_grains_file(grains_fragment_file) %}{% include grains_fragment_file ignore missing %}{% endmacro %}
  File "/var/cache/salt/minion/files/base/apache/meta/heka.yml", line 2, in top-level template code
    {%- if server.get('enabled', False) and server.get('site', {}).values()|selectattr("type", "equalto", "keystone")|list|length > 0 %}
  File "/usr/lib/python2.7/dist-packages/jinja2/filters.py", line 740, in do_list
    return list(value)
  File "/usr/lib/python2.7/dist-packages/jinja2/filters.py", line 931, in _select_or_reject
    if modfunc(func(transfunc(item))):
  File "/usr/lib/python2.7/dist-packages/jinja2/filters.py", line 925, in <lambda>
    name, item, args, kwargs)
  File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 438, in call_test
    raise TemplateRuntimeError('no test named %r' % name)
TemplateRuntimeError: no test named 'equalto'

Versions:

root@ctl-01:/var/log/nova# salt-call --versions-report
Salt Version:
           Salt: 2016.3.6
 
Dependency Versions:
           cffi: 1.1.2
       cherrypy: Not Installed
       dateutil: 1.5
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.21.1
           Mako: 0.9.1
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: 1.2.3
      pycparser: 2.10
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.6 (default, Oct 26 2016, 20:30:19)
   python-gnupg: Not Installed
         PyYAML: 3.10
          PyZMQ: 14.0.1
           RAET: Not Installed
          smmap: Not Installed
        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-66-generic
         system: Linux
        version: Ubuntu 14.04 trusty
 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant