# Buggy code
def info(*packages):
    """
    Return a detailed package(s) summary information.
    If no packages specified, all packages will be returned.

    :param packages:
    :return:

    CLI example:

    .. code-block:: bash

        salt '*' lowpkg.info apache2 bash
    """
    # Get the missing information from the /var/lib/dpkg/available, if it is there.
    # However, this file is operated by dselect which has to be installed.
    dselect_pkg_avail = _get_pkg_ds_avail()

    ret = dict()
    for pkg in _get_pkg_info(*packages):
        # Merge extra information from the dselect, if available
        for pkg_ext_k, pkg_ext_v in dselect_pkg_avail.get(pkg["package"], {}).items():
            if pkg_ext_k not in pkg:
                pkg[pkg_ext_k] = pkg_ext_v
        # Remove "technical" keys
        for t_key in [
            "installed_size",
            "depends",
            "recommends",
            "provides",
            "replaces",
            "conflicts",
            "bugs",
            "description-md5",
            "task",
        ]:
            if t_key in pkg:
                del pkg[t_key]

        lic = _get_pkg_license(pkg["package"])
        if lic:
            pkg["license"] = lic
        ret[pkg["package"]] = pkg

    return ret


# Traceback (KeyError)
root@localhost:~/salt# salt '*' pkg.info_installed bash-completion
ubuntu:
The minion function caused an exception: Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 1039, in _thread_return
return_data = func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/salt/modules/aptpkg.py", line 2245, in info_installed
for pkg_name, pkg_nfo in __salt__['lowpkg.info'](*names).items():
File "/usr/lib/python2.7/dist-packages/salt/modules/dpkg.py", line 383, in info
for pkg_ext_k, pkg_ext_v in dselect_pkg_avail.get(pkg['package'], {}).items():
KeyError: 'package'

# Fixed code
def info(*packages):
    """
    Returns a detailed summary of package information for provided package names.
    If no packages are specified, all packages will be returned.

    .. versionadded:: 2015.8.1

    packages
        The names of the packages for which to return information.

    CLI example:

    .. code-block:: bash

        salt '*' lowpkg.info
        salt '*' lowpkg.info apache2 bash
    """
    # Get the missing information from the /var/lib/dpkg/available, if it is there.
    # However, this file is operated by dselect which has to be installed.
    dselect_pkg_avail = _get_pkg_ds_avail()

    ret = dict()
    for pkg in _get_pkg_info(*packages):
        # Merge extra information from the dselect, if available
        for pkg_ext_k, pkg_ext_v in dselect_pkg_avail.get(pkg["package"], {}).items():
            if pkg_ext_k not in pkg:
                pkg[pkg_ext_k] = pkg_ext_v
        # Remove "technical" keys
        for t_key in [
            "installed_size",
            "depends",
            "recommends",
            "provides",
            "replaces",
            "conflicts",
            "bugs",
            "description-md5",
            "task",
        ]:
            if t_key in pkg:
                del pkg[t_key]

        lic = _get_pkg_license(pkg["package"])
        if lic:
            pkg["license"] = lic
        ret[pkg["package"]] = pkg

    return ret