# Buggy code
def get(key, default=""):
    """
    .. versionadded:: 0.14

    Attempt to retrieve the named value from pillar, if the named value is not
    available return the passed default. The default return is an empty string.

    The value can also represent a value in a nested dict using a ":" delimiter
    for the dict. This means that if a dict in pillar looks like this::

        {'pkg': {'apache': 'httpd'}}

    To retrieve the value associated with the apache key in the pkg dict this
    key can be passed::

        pkg:apache

    CLI Example:

    .. code-block:: bash

        salt '*' pillar.get pkg:apache
    """
    return salt.utils.traverse_dict_and_list(__pillar__, key, default)


# Traceback (TypeError)
archlinux$ salt-ssh '*' state.highstate
[CRITICAL] Rendering SLS 'base:salt.master' failed: Jinja error: get() got an unexpected keyword argument 'merge'
/tmp/.vagrant_1d5674__salt/running_data/var/cache/salt/minion/files/base/salt/map.jinja(71):

---
[...]
'syndic_service': 'salt_syndic'},
}, merge=salt['pillar.get']('salt:lookup')) %}

{% do default_settings.salt.update(distro_map) %}

{% set salt_settings = salt['pillar.get']('salt', default=default_settings.salt,    <======================
merge=True) %}

---
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/utils/templates.py", line 280, in render_jinja_tmpl
output = template.render(**decoded_context)
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
reraise(exc_type, exc_value, tb)
File "<template>", line 1, in top-level template code
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 1013, in make_module
return TemplateModule(self, self.new_context(vars, shared, locals))
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 1070, in __init__
self._body_stream = list(template.root_render_func(context))
File "/tmp/.vagrant_1d5674__salt/running_data/var/cache/salt/minion/files/base/salt/map.jinja", line 71, in top-level template code
{% set salt_settings = salt['pillar.get']('salt', default=default_settings.salt,
TypeError: get() got an unexpected keyword argument 'merge'

# Fixed code
def get(key, default="", merge=False, delimiter=":"):
    """
    .. versionadded:: 0.14

    Attempt to retrieve the named value from pillar, if the named value is not
    available return the passed default. The default return is an empty string.

    The value can also represent a value in a nested dict using a ":" delimiter
    for the dict. This means that if a dict in pillar looks like this::

        {'pkg': {'apache': 'httpd'}}

    To retrieve the value associated with the apache key in the pkg dict this
    key can be passed::

        pkg:apache

    merge
        Specify whether or not the retrieved values should be recursively
        merged into the passed default.

        .. versionadded:: 2015.5.1

    delimiter
        Specify an alternate delimiter to use when traversing a nested dict

        .. versionadded:: 2015.5.1

    CLI Example:

    .. code-block:: bash

        salt '*' pillar.get pkg:apache
    """
    if merge:
        ret = salt.utils.traverse_dict_and_list(__pillar__, key, {}, delimiter)
        if isinstance(ret, collections.Mapping) and isinstance(
            default, collections.Mapping
        ):
            return salt.utils.dictupdate.update(default, ret)

    return salt.utils.traverse_dict_and_list(__pillar__, key, default, delimiter)