{"action":"closed","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/23087","labels_url":"https://api.github.com/repos/saltstack/salt/issues/23087/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/23087/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/23087/events","html_url":"https://github.com/saltstack/salt/issues/23087","id":71293407,"number":23087,"title":"filter_by() got an unexpected keyword argument 'default'","user":{"login":"lichtamberg","id":10075,"avatar_url":"https://avatars.githubusercontent.com/u/10075?v=3","gravatar_id":"","url":"https://api.github.com/users/lichtamberg","html_url":"https://github.com/lichtamberg","followers_url":"https://api.github.com/users/lichtamberg/followers","following_url":"https://api.github.com/users/lichtamberg/following{/other_user}","gists_url":"https://api.github.com/users/lichtamberg/gists{/gist_id}","starred_url":"https://api.github.com/users/lichtamberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lichtamberg/subscriptions","organizations_url":"https://api.github.com/users/lichtamberg/orgs","repos_url":"https://api.github.com/users/lichtamberg/repos","events_url":"https://api.github.com/users/lichtamberg/events{/privacy}","received_events_url":"https://api.github.com/users/lichtamberg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-27T14:01:41Z","updated_at":"2015-04-27T14:25:25Z","closed_at":"2015-04-27T14:25:25Z","body":"Trying to use this formula https://github.com/saltstack-formulas/couchdb-formula and receive\r\n\r\n```\r\nfilter_by() got an unexpected keyword argument 'default'\r\n```\r\n\r\nWorking on:\r\nOSX 10.9.5\r\nPython 2.7.9\r\n\r\nError message:\r\n```\r\n    - Rendering SLS 'base:couchdb.install' failed: Jinja error: filter_by() got an unexpected keyword argument 'default'\r\n    - /tmp/.deployer_85176d__salt/running_data/var/cache/salt/minion/files/base/couchdb/map.jinja(31):\r\n    - ---\r\n    - [...]\r\n    -     }\r\n    -   }\r\n    - %}\r\n    -\r\n    - {# merge default values with the ones received in pillar.get #}\r\n    - {% set couchdb  = salt['grains.filter_by'](conf_defaults, grain='None', merge=couchdb, default='couchdb') %}    <======================\r\n    -\r\n    - {% set merge_props = {\r\n    -      'couchdb'  : {\r\n    -        'source' :  'https://www.apache.org/dist/couchdb/source/' + couchdb.version + '/apache-couchdb-' + couchdb.version + '.tar.gz',\r\n    -        'source_hash'   :  'https://www.apache.org/dist/couchdb/source/' + couchdb.version + '/apache-couchdb-' + couchdb.version + '.tar.gz.md5'\r\n    - [...]\r\n    - ---\r\n    - Traceback (most recent call last):\r\n    -   File \"/usr/local/lib/python2.7/site-packages/salt/utils/templates.py\", line 280, in render_jinja_tmpl\r\n    -     output = template.render(**decoded_context)\r\n    -   File \"/usr/local/lib/python2.7/site-packages/jinja2/environment.py\", line 969, in render\r\n    -     return self.environment.handle_exception(exc_info, True)\r\n    -   File \"/usr/local/lib/python2.7/site-packages/jinja2/environment.py\", line 742, in handle_exception\r\n    -     reraise(exc_type, exc_value, tb)\r\n    -   File \"<template>\", line 4, in top-level template code\r\n    -   File \"/usr/local/lib/python2.7/site-packages/jinja2/environment.py\", line 1013, in make_module\r\n    -     return TemplateModule(self, self.new_context(vars, shared, locals))\r\n    -   File \"/usr/local/lib/python2.7/site-packages/jinja2/environment.py\", line 1070, in __init__\r\n    -     self._body_stream = list(template.root_render_func(context))\r\n    -   File \"/tmp/.deployer_85176d__salt/running_data/var/cache/salt/minion/files/base/couchdb/map.jinja\", line 31, in top-level template code\r\n    -     {% set couchdb  = salt['grains.filter_by'](conf_defaults, grain='None', merge=couchdb, default='couchdb') %}\r\n    - TypeError: filter_by() got an unexpected keyword argument 'default'\r\n    -\r\n    - Rendering SLS 'base:couchdb.user' failed: Jinja error: filter_by() got an unexpected keyword argument 'default'\r\n    - /tmp/.deployer_85176d__salt/running_data/var/cache/salt/minion/files/base/couchdb/map.jinja(31):\r\n    - ---\r\n    - [...]\r\n    -     }\r\n    -   }\r\n    - %}\r\n    -\r\n    - {# merge default values with the ones received in pillar.get #}\r\n    - {% set couchdb  = salt['grains.filter_by'](conf_defaults, grain='None', merge=couchdb, default='couchdb') %}    <======================\r\n    -\r\n    - {% set merge_props = {\r\n    -      'couchdb'  : {\r\n    -        'source' :  'https://www.apache.org/dist/couchdb/source/' + couchdb.version + '/apache-couchdb-' + couchdb.version + '.tar.gz',\r\n    -        'source_hash'   :  'https://www.apache.org/dist/couchdb/source/' + couchdb.version + '/apache-couchdb-' + couchdb.version + '.tar.gz.md5'\r\n    - [...]\r\n    - ---\r\n    - Traceback (most recent call last):\r\n    -   File \"/usr/local/lib/python2.7/site-packages/salt/utils/templates.py\", line 280, in render_jinja_tmpl\r\n    -     output = template.render(**decoded_context)\r\n    -   File \"/usr/local/lib/python2.7/site-packages/jinja2/environment.py\", line 969, in render\r\n    -     return self.environment.handle_exception(exc_info, True)\r\n    -   File \"/usr/local/lib/python2.7/site-packages/jinja2/environment.py\", line 742, in handle_exception\r\n    -     reraise(exc_type, exc_value, tb)\r\n    -   File \"<template>\", line 4, in top-level template code\r\n    -   File \"/usr/local/lib/python2.7/site-packages/jinja2/environment.py\", line 1013, in make_module\r\n    -     return TemplateModule(self, self.new_context(vars, shared, locals))\r\n    -   File \"/usr/local/lib/python2.7/site-packages/jinja2/environment.py\", line 1070, in __init__\r\n    -     self._body_stream = list(template.root_render_func(context))\r\n    -   File \"/tmp/.deployer_85176d__salt/running_data/var/cache/salt/minion/files/base/couchdb/map.jinja\", line 31, in top-level template code\r\n    -     {% set couchdb  = salt['grains.filter_by'](conf_defaults, grain='None', merge=couchdb, default='couchdb') %}\r\n    - TypeError: filter_by() got an unexpected keyword argument 'default'\r\n```\r\n\r\n\r\nIt looks like the port to OSX is not up to date \r\n```\r\n# /usr/local/lib/python2.7/site-packages/salt/client/ssh/wrapper/grains.py:142\r\ndef filter_by(lookup_dict, grain='os_family', merge=None):\r\n....\r\n```\r\n\r\n```\r\n ~/salt  ± master ●  pip show salt\r\n---\r\nMetadata-Version: 1.0\r\nName: salt\r\nVersion: 2014.7.5\r\nSummary: Portable, distributed, remote execution and configuration management system\r\nHome-page: http://saltstack.org\r\nAuthor: Thomas S Hatch\r\nAuthor-email: thatch45@gmail.com\r\nLicense: Apache Software License 2.0\r\nLocation: /usr/local/lib/python2.7/site-packages\r\nRequires: Jinja2, msgpack-python, PyYAML, MarkupSafe, requests\r\nEntry-points:\r\n  [console_scripts]\r\n  salt = salt.scripts:salt_main\r\n  salt-api = salt.scripts:salt_api\r\n  salt-call = salt.scripts:salt_call\r\n  salt-cloud = salt.scripts:salt_cloud\r\n  salt-cp = salt.scripts:salt_cp\r\n  salt-key = salt.scripts:salt_key\r\n  salt-master = salt.scripts:salt_master\r\n  salt-minion = salt.scripts:salt_minion\r\n  salt-run = salt.scripts:salt_run\r\n  salt-ssh = salt.scripts:salt_ssh\r\n  salt-syndic = salt.scripts:salt_syndic\r\n  salt-unity = salt.scripts:salt_unity\r\n```"}}